Make WordPress Core


Ignore:
Timestamp:
04/19/2006 03:03:27 AM (19 years ago)
Author:
ryan
Message:

Move htmlentities2 to functions-formatting.php. #2525

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-formatting.php

    r3713 r3717  
    10331033}
    10341034
     1035// Borrowed from the PHP Manual user notes. Convert entities, while
     1036// preserving already-encoded entities:
     1037function htmlentities2($myHTML) {
     1038    $translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES);
     1039    $translation_table[chr(38)] = '&';
     1040    return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table));
     1041}
     1042
    10351043?>
Note: See TracChangeset for help on using the changeset viewer.