Make WordPress Core

Changeset 1118


Ignore:
Timestamp:
04/22/2004 12:44:14 AM (21 years ago)
Author:
saxmatt
Message:

Use word fixes all the time.

File:
1 edited

Legend:

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

    r1052 r1118  
    8888}
    8989
    90 function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') { // html/unicode entities output
     90function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') {
     91    // html/unicode entities output
    9192    global $wp_htmltrans, $wp_htmltranswinuni;
    9293
     
    9495    $content = preg_replace('/<title>(.+?)<\/title>/','',$content);
    9596    $content = preg_replace('/<category>(.+?)<\/category>/','',$content);
    96    
     97    // converts lone & characters into &#38; (a.k.a. &amp;)
     98    $content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&#38;".substr("\0",1)', $content);
     99    $content = strtr($content, $wp_htmltranswinuni);
    97100    if (get_settings('use_htmltrans')) {
    98         // converts lone & characters into &#38; (a.k.a. &amp;)
    99         $content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&#38;".substr("\0",1)', $content);
    100101        // converts HTML-entities to their display values in order to convert them again later
    101102        $content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content );
    102103        $content = strtr($content, $wp_htmltrans);
    103         // now converting: Windows CP1252 => Unicode (valid HTML)
    104         // (if you've ever pasted text from MSWord, you'll understand)
    105         $content = strtr($content, $wp_htmltranswinuni);
    106104    }
    107105
    108106    // you can delete these 2 lines if you don't like <br /> and <hr />
    109     $content = str_replace("<br>","<br />",$content);
    110     $content = str_replace("<hr>","<hr />",$content);
     107    $content = str_replace('<br>', '<br />',$content);
     108    $content = str_replace('<hr>', '<hr />',$content);
    111109
    112110    return $content;
Note: See TracChangeset for help on using the changeset viewer.