[wp-cvs] wordpress/wp-includes functions.php,1.101.4.3,1.101.4.4
Ernest MacDougal Campbell III
emc3 at users.sourceforge.net
Tue Oct 12 14:58:03 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17704/wp-includes
Modified Files:
Tag: WordPress-Ver-1_2-Branch
functions.php
Log Message:
Added htmlentities2 function
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.101.4.3
retrieving revision 1.101.4.4
diff -C2 -d -r1.101.4.3 -r1.101.4.4
*** functions.php 5 Oct 2004 22:39:07 -0000 1.101.4.3
--- functions.php 12 Oct 2004 14:58:00 -0000 1.101.4.4
***************
*** 1360,1362 ****
--- 1360,1370 ----
}
+ // Borrowed from the PHP Manual user notes. Convert entities, while
+ // preserving already-encoded entities:
+ function htmlentities2($myHTML) {
+ $translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES);
+ $translation_table[chr(38)] = '&';
+ return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table));
+ }
+
?>
\ No newline at end of file
More information about the cvs
mailing list