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
This commit is contained in:
michelvaldrighi 2004-12-30 17:34:27 +00:00
parent 1cdfae48cc
commit c5f6ac8cc4
1 changed files with 3 additions and 39 deletions

View File

@ -291,44 +291,11 @@ function convert_chars($content, $flag = 'obsolete') {
function funky_javascript_fix($text) { function funky_javascript_fix($text) {
// Fixes for browsers' javascript bugs // Fixes for browsers' javascript bugs
global $is_macIE, $is_winIE, $is_gecko; global $is_macIE, $is_winIE;
$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);
if ( $is_winIE ) if ( $is_winIE || $is_macIE )
$text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); $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; return $text;
} }
@ -452,10 +419,7 @@ function format_to_post($content) {
} }
function zeroise($number,$threshold) { // function to add leading zeros when necessary function zeroise($number,$threshold) { // function to add leading zeros when necessary
$l=strlen($number); return sprintf('%0'.$threshold.'s', $number);
if ($l<$threshold)
for ($i=0; $i<($threshold-$l); $i=$i+1) { $number='0'.$number; }
return $number;
} }