CodefyPHP FrameworkCodefyPHP Framework
  • Home
  • Community
    • Forum
    • Github
    • YouTube
  • News
  • Home
  • Community
    • Forum
    • Github
    • YouTube
  • News
home/Knowledge Base/Helpers/purify_html
Popular Search:installation, codex, mail

purify_html

17 views 0

Written by Joshua
August 14, 2024

Description

Makes content safe to print on screen.

This function should only be used on output. Except uploading images, never use this function on input. All inputted data should be accepted and then purified on output for optimal results. For output of images, make sure to escape with esc_url().

Usage

<?php

use function Qubus\Security\Helpers\purify_html;

purify_html(string $string, bool $isImage = false): string;

Parameters

$string (string) (required) Output to purify.

$isImage (bool) (optional) Whether the output is an image.

Return Value

(string) The purified output.

Edit on Github

Last Updated on August 14, 2024 by Joshua

Related Articles
  • mail
  • sort_element_callback
  • php_where
  • php_like
  • convert_array_to_object
  • compact_unique_array

Didn't find your answer? Check out the Forum

Leave A Comment Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  esc_js

flatten_array  

  • Copyright 2025 CodefyPHP.com. All Rights Reserved

Popular Search:installation, codex, mail