Changeset 1118
- Timestamp:
- 04/22/2004 12:44:14 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-formatting.php
r1052 r1118 88 88 } 89 89 90 function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') { // html/unicode entities output 90 function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') { 91 // html/unicode entities output 91 92 global $wp_htmltrans, $wp_htmltranswinuni; 92 93 … … 94 95 $content = preg_replace('/<title>(.+?)<\/title>/','',$content); 95 96 $content = preg_replace('/<category>(.+?)<\/category>/','',$content); 96 97 // converts lone & characters into & (a.k.a. &) 98 $content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&".substr("\0",1)', $content); 99 $content = strtr($content, $wp_htmltranswinuni); 97 100 if (get_settings('use_htmltrans')) { 98 // converts lone & characters into & (a.k.a. &)99 $content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&".substr("\0",1)', $content);100 101 // converts HTML-entities to their display values in order to convert them again later 101 102 $content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content ); 102 103 $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);106 104 } 107 105 108 106 // 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); 111 109 112 110 return $content;
Note: See TracChangeset
for help on using the changeset viewer.