You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of ENT_DISALLOWED is misleading.
It states: "Replace invalid code points for the given document type with a Unicode Replacement Character U+FFFD (UTF-8) or &#FFFD; (otherwise) instead of leaving them as is. This may be useful, for instance, to ensure the well-formedness of XML documents with embedded external content."
It should say somenthing like: "Returns an empty string when invalid code points for the given document are found."
Tested using the following code:
$string = "This is a test: \x80\x81";
echo htmlentities($string, ENT_SUBSTITUTE, 'UTF-8');
// Output: This is a test: ��
echo "\n";
$string = "This is a test: \x80\x81";
echo htmlentities($string, ENT_DISALLOWED, 'UTF-8');
// Output: <empty line>
echo "\n";
$string = "This is a test: xx";
echo htmlentities($string, ENT_DISALLOWED, 'UTF-8');
// Output: This is a test: xx
The text was updated successfully, but these errors were encountered:
From manual page: https://php.net/function.htmlentities
Description of ENT_DISALLOWED is misleading.
It states: "Replace invalid code points for the given document type with a Unicode Replacement Character U+FFFD (UTF-8) or &#FFFD; (otherwise) instead of leaving them as is. This may be useful, for instance, to ensure the well-formedness of XML documents with embedded external content."
It should say somenthing like: "Returns an empty string when invalid code points for the given document are found."
Tested using the following code:
The text was updated successfully, but these errors were encountered: