note 117113 added to function.htmlspecialchars

From: Date: Thu, 16 Apr 2015 10:21:50 +0000
Subject: note 117113 added to function.htmlspecialchars
Groups: php.notes 
Request: Send a blank email to php-notes+get-202281@lists.php.net to get a copy of this message
I found a simple solution for the changed default character encoding in htmlspecialchars, htmlentities and html_entity_decode, so my (very) old code kept running: <?php if (version_compare(phpversion(), "5.3.3", ">")) { runkit_function_rename('htmlspecialchars', 'htmlspecialchars_new'); runkit_function_add( 'htmlspecialchars', '$string, $flags, $encoding', 'return $encoding == "" ? htmlspecialchars_new($string, ENT_COMPAT | ENT_HTML401, "ISO-8859-1") : htmlspecialchars_new($string, $flags, $encoding);' ); runkit_function_rename('htmlentities', 'htmlentities_new'); runkit_function_add( 'htmlentities', '$string, $flags, $encoding', 'return $encoding == "" ? htmlentities_new($string, ENT_COMPAT | ENT_HTML401, "ISO-8859-1") : htmlentities_new($string, $flags, $encoding);' ); runkit_function_rename('html_entity_decode', 'html_entity_decode_new'); runkit_function_add( 'html_entity_decode', '$string, $flags, $encoding', 'return $encoding == "" ? html_entity_decode_new($string, ENT_COMPAT | ENT_HTML401, "ISO-8859-1") : html_entity_decode_new($string, $flags, $encoding);' ); } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 93.108.136.36 ---- Manual Page -- http://php.net/manual/en/function.htmlspecialchars.php Edit -- https://master.php.net/note/edit/117113 Del: integrated -- https://master.php.net/note/delete/117113/integrated Del: useless -- https://master.php.net/note/delete/117113/useless Del: bad code -- https://master.php.net/note/delete/117113/bad+code Del: spam -- https://master.php.net/note/delete/117113/spam Del: non-english -- https://master.php.net/note/delete/117113/non-english Del: in docs -- https://master.php.net/note/delete/117113/in+docs Del: other reasons-- https://master.php.net/note/delete/117113 Reject -- https://master.php.net/note/reject/117113 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#202281) next »