From 28eef6a8da6522951a6b23d5e891461077997859 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 22 Apr 2004 00:44:14 +0000 Subject: [PATCH] Use word fixes all the time. git-svn-id: http://svn.automattic.com/wordpress/trunk@1118 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions-formatting.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index b1aa8f1b64..31efd738f2 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -87,27 +87,25 @@ function sanitize_title($title) { return $title; } -function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') { // html/unicode entities output +function convert_chars($content, $flag='obsolete attribute left there for backwards compatibility') { + // html/unicode entities output global $wp_htmltrans, $wp_htmltranswinuni; // removes metadata tags $content = preg_replace('/(.+?)<\/title>/','',$content); $content = preg_replace('/<category>(.+?)<\/category>/','',$content); - + // converts lone & characters into & (a.k.a. &) + $content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&".substr("\0",1)', $content); + $content = strtr($content, $wp_htmltranswinuni); if (get_settings('use_htmltrans')) { - // converts lone & characters into & (a.k.a. &) - $content = preg_replace('/&[^#](?![a-z]*;)/ie', '"&".substr("\0",1)', $content); // converts HTML-entities to their display values in order to convert them again later $content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content ); $content = strtr($content, $wp_htmltrans); - // now converting: Windows CP1252 => Unicode (valid HTML) - // (if you've ever pasted text from MSWord, you'll understand) - $content = strtr($content, $wp_htmltranswinuni); } // you can delete these 2 lines if you don't like <br /> and <hr /> - $content = str_replace("<br>","<br />",$content); - $content = str_replace("<hr>","<hr />",$content); + $content = str_replace('<br>', '<br />',$content); + $content = str_replace('<hr>', '<hr />',$content); return $content; }