From c5f6ac8cc458a4a5a8a854473d9ef3b7d57a9239 Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Thu, 30 Dec 2004 17:34:27 +0000 Subject: [PATCH] fixed bad b2 mistakes: zeroise is really a glorified sprintf; funky_javascript_fix was only needed for Gecko because of bad Apaches running with AddDefaultCharset On, and the fixes for Gecko weren't even accurate git-svn-id: https://develop.svn.wordpress.org/trunk@2018 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions-formatting.php | 42 ++-------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 5070c29a2e..f44bb9cb9b 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -291,44 +291,11 @@ function convert_chars($content, $flag = 'obsolete') { function funky_javascript_fix($text) { // Fixes for browsers' javascript bugs - global $is_macIE, $is_winIE, $is_gecko; - $wp_macIE_correction['in'] = array( - '/\%uFFD4/', '/\%uFFD5/', '/\%uFFD2/', '/\%uFFD3/', - '/\%uFFA5/', '/\%uFFD0/', '/\%uFFD1/', '/\%uFFBD/', - '/\%uFF83%uFFC0/', '/\%uFF83%uFFC1/', '/\%uFF83%uFFC6/', '/\%uFF83%uFFC9/', - '/\%uFFB9/', '/\%uFF81%uFF8C/', '/\%uFF81%uFF8D/', '/\%uFF81%uFFDA/', - '/\%uFFDB/' - ); - $wp_macIE_correction['out'] = array( - '‘', '’', '“', '”', - '•', '–', '—', 'Ω', - 'β', 'γ', 'θ', 'λ', - 'π', '′', '″', '∠', - '€' - ); - $wp_gecko_correction['in'] = array( - '/\‘/', '/\’/', '/\“/', '/\”/', - '/\•/', '/\–/', '/\—/', '/\O/', - '/\ß/', '/\?/', '/\?/', '/\?/', - '/\p/', '/\'/', '/\?/', '/\/', - '/\€/', '/\?/' - ); - $wp_gecko_correction['out'] = array( - '&8216;', '’', '“', '”', - '•', '–', '—', 'Ω', - 'β', 'γ', 'θ', 'λ', - 'π', '′', '″', '∠', - '€', ' ' - ); - if ( $is_macIE ) - $text = preg_replace('/'.$wp_macIE_correction["in"].'/', '/'.$wp_macIE_correction["out"].'/', $text); + global $is_macIE, $is_winIE; - if ( $is_winIE ) + if ( $is_winIE || $is_macIE ) $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); - if ( $is_gecko ) - $text = preg_replace('/'.$wp_gecko_correction["in"].'/','/'.$wp_gecko_correction["out"].'/',$text); - return $text; } @@ -452,10 +419,7 @@ function format_to_post($content) { } function zeroise($number,$threshold) { // function to add leading zeros when necessary - $l=strlen($number); - if ($l<$threshold) - for ($i=0; $i<($threshold-$l); $i=$i+1) { $number='0'.$number; } - return $number; + return sprintf('%0'.$threshold.'s', $number); }