Changeset 1994
- Timestamp:
- 12/23/2004 12:08:43 AM (21 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-admin/bookmarklet.php (modified) (1 diff)
-
wp-includes/functions-formatting.php (modified) (2 diffs)
-
wp-includes/vars.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/bookmarklet.php
r1993 r1994 21 21 <?php 22 22 } else { 23 $popuptitle = wp_specialchars(stripslashes($popuptitle)); 24 $text = wp_specialchars(stripslashes(urldecode($text))); 25 26 /* big funky fixes for browsers' javascript bugs */ 27 28 if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) { 29 $popuptitle = preg_replace('/'.$wp_macIE_correction["in"].'/','/'.$wp_macIE_correction["out"].'/',$popuptitle); 30 $text = preg_replace('/'.$wp_macIE_correction["in"].'/','/'.$wp_macIE_correction["out"].'/',$text); 31 } 32 33 if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) { 34 $popuptitle = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $popuptitle); 35 $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); 36 } 37 38 if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) { 39 $popuptitle = preg_replace('/'.$wp_gecko_correction["in"].'/','/'.$wp_gecko_correction["out"].'/',$popuptitle); 40 $text = preg_replace('/'.$wp_gecko_correction["in"].'/','/'.$wp_gecko_correction["out"].'/',$text); 41 } 42 43 $post_title = wp_specialchars($_REQUEST['post_title']); 44 if (!empty($post_title)) { 45 $post_title = stripslashes($post_title); 46 } else { 47 $post_title = $popuptitle; 48 } 49 50 $edited_post_title = wp_specialchars($post_title); 23 $popuptitle = wp_specialchars(stripslashes($popuptitle)); 24 $text = wp_specialchars(stripslashes(urldecode($text))); 25 26 $popuptitle = funky_javascript_fix($popuptitle); 27 $text = funky_javascript_fix($text); 28 29 $post_title = wp_specialchars($_REQUEST['post_title']); 30 if (!empty($post_title)) { 31 $post_title = stripslashes($post_title); 32 } else { 33 $post_title = $popuptitle; 34 } 35 36 $edited_post_title = wp_specialchars($post_title); 51 37 52 38 // $post_pingback needs to be set in any file that includes edit-form.php -
trunk/wp-includes/functions-formatting.php
r1984 r1994 237 237 238 238 function convert_chars($content, $flag = 'obsolete') { 239 global $wp_htmltranswinuni; 239 // Translation of invalid Unicode references range to valid range 240 $wp_htmltranswinuni = array( 241 '€' => '€', // the Euro sign 242 '' => '', 243 '‚' => '‚', // these are Windows CP1252 specific characters 244 'ƒ' => 'ƒ', // they would look weird on non-Windows browsers 245 '„' => '„', 246 '…' => '…', 247 '†' => '†', 248 '‡' => '‡', 249 'ˆ' => 'ˆ', 250 '‰' => '‰', 251 'Š' => 'Š', 252 '‹' => '‹', 253 'Œ' => 'Œ', 254 '' => '', 255 'Ž' => 'ž', 256 '' => '', 257 '' => '', 258 '‘' => '‘', 259 '’' => '’', 260 '“' => '“', 261 '”' => '”', 262 '•' => '•', 263 '–' => '–', 264 '—' => '—', 265 '˜' => '˜', 266 '™' => '™', 267 'š' => 'š', 268 '›' => '›', 269 'œ' => 'œ', 270 '' => '', 271 'ž' => '', 272 'Ÿ' => 'Ÿ' 273 ); 240 274 241 275 // Remove metadata tags … … 254 288 255 289 return $content; 290 } 291 292 function funky_javascript_fix($text) { 293 // Fixes for browsers' javascript bugs 294 global $is_macIE, $is_winIE, $is_gecko; 295 $wp_macIE_correction['in'] = array( 296 '/\%uFFD4/', '/\%uFFD5/', '/\%uFFD2/', '/\%uFFD3/', 297 '/\%uFFA5/', '/\%uFFD0/', '/\%uFFD1/', '/\%uFFBD/', 298 '/\%uFF83%uFFC0/', '/\%uFF83%uFFC1/', '/\%uFF83%uFFC6/', '/\%uFF83%uFFC9/', 299 '/\%uFFB9/', '/\%uFF81%uFF8C/', '/\%uFF81%uFF8D/', '/\%uFF81%uFFDA/', 300 '/\%uFFDB/' 301 ); 302 $wp_macIE_correction['out'] = array( 303 '‘', '’', '“', '”', 304 '•', '–', '—', 'Ω', 305 'β', 'γ', 'θ', 'λ', 306 'π', '′', '″', '∠', 307 '€' 308 ); 309 $wp_gecko_correction['in'] = array( 310 '/\/', '/\/', '/\/', '/\/', 311 '/\/', '/\/', '/\/', '/\O/', 312 '/\ß/', '/\?/', '/\?/', '/\?/', 313 '/\p/', '/\'/', '/\?/', '/\/', 314 '/\/', '/\?/' 315 ); 316 $wp_gecko_correction['out'] = array( 317 '&8216;', '’', '“', '”', 318 '•', '–', '—', 'Ω', 319 'β', 'γ', 'θ', 'λ', 320 'π', '′', '″', '∠', 321 '€', ' ' 322 ); 323 if ( $is_macIE ) 324 $text = preg_replace('/'.$wp_macIE_correction["in"].'/', '/'.$wp_macIE_correction["out"].'/', $text); 325 326 if ( $is_winIE ) 327 $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); 328 329 if ( $is_gecko ) 330 $text = preg_replace('/'.$wp_gecko_correction["in"].'/','/'.$wp_gecko_correction["out"].'/',$text); 331 332 return $text; 256 333 } 257 334 -
trunk/wp-includes/vars.php
r1974 r1994 3 3 /* This file sets various arrays and variables for use in WordPress */ 4 4 require(ABSPATH . 'wp-includes/version.php'); 5 6 # Translation of invalid Unicode references range to valid range7 $wp_htmltranswinuni = array(8 '€' => '€', // the Euro sign9 '' => '',10 '‚' => '‚', // these are Windows CP1252 specific characters11 'ƒ' => 'ƒ', // they would look weird on non-Windows browsers12 '„' => '„',13 '…' => '…',14 '†' => '†',15 '‡' => '‡',16 'ˆ' => 'ˆ',17 '‰' => '‰',18 'Š' => 'Š',19 '‹' => '‹',20 'Œ' => 'Œ',21 '' => '',22 'Ž' => 'ž',23 '' => '',24 '' => '',25 '‘' => '‘',26 '’' => '’',27 '“' => '“',28 '”' => '”',29 '•' => '•',30 '–' => '–',31 '—' => '—',32 '˜' => '˜',33 '™' => '™',34 'š' => 'š',35 '›' => '›',36 'œ' => 'œ',37 '' => '',38 'ž' => '',39 'Ÿ' => 'Ÿ'40 );41 5 42 6 // On which page are we ? … … 75 39 } 76 40 $is_IE = (($is_macIE) || ($is_winIE)); 77 78 // browser-specific javascript corrections79 $wp_macIE_correction['in'] = array(80 '/\%uFFD4/', '/\%uFFD5/', '/\%uFFD2/', '/\%uFFD3/',81 '/\%uFFA5/', '/\%uFFD0/', '/\%uFFD1/', '/\%uFFBD/',82 '/\%uFF83%uFFC0/', '/\%uFF83%uFFC1/', '/\%uFF83%uFFC6/', '/\%uFF83%uFFC9/',83 '/\%uFFB9/', '/\%uFF81%uFF8C/', '/\%uFF81%uFF8D/', '/\%uFF81%uFFDA/',84 '/\%uFFDB/'85 );86 $wp_macIE_correction['out'] = array(87 '‘', '’', '“', '”',88 '•', '–', '—', 'Ω',89 'β', 'γ', 'θ', 'λ',90 'π', '′', '″', '∠',91 '€'92 );93 $wp_gecko_correction['in'] = array(94 '/\‘/', '/\’/', '/\“/', '/\”/',95 '/\•/', '/\–/', '/\—/', '/\Ω/',96 '/\β/', '/\γ/', '/\θ/', '/\λ/',97 '/\π/', '/\′/', '/\″/', '/\/',98 '/\€/', '/\ /'99 );100 $wp_gecko_correction['out'] = array(101 '&8216;', '’', '“', '”',102 '•', '–', '—', 'Ω',103 'β', 'γ', 'θ', 'λ',104 'π', '′', '″', '∠',105 '€', ' '106 );107 41 108 42 // Server detection
Note: See TracChangeset
for help on using the changeset viewer.