Ticket #13900: 13900.patch
| File 13900.patch, 15.3 KB (added by , 16 years ago) |
|---|
-
wp-admin/includes/media.php
1300 1300 $hidden_fields = array(); 1301 1301 1302 1302 foreach ( $form_fields as $id => $field ) { 1303 if ( $id {0}== '_' )1303 if ( $id[0] == '_' ) 1304 1304 continue; 1305 1305 1306 1306 if ( !empty( $field['tr'] ) ) { -
wp-admin/includes/misc.php
569 569 * see http://bugs.php.net/bug.php?id=30931 570 570 */ 571 571 572 if ( $path {strlen($path)-1}== '/' ) // recursively return a temporary file path572 if ( $path[strlen($path)-1] == '/' ) // recursively return a temporary file path 573 573 return win_is_writable($path . uniqid(mt_rand()) . '.tmp'); 574 574 else if ( is_dir($path) ) 575 575 return win_is_writable($path . '/' . uniqid(mt_rand()) . '.tmp'); -
wp-admin/import.php
62 62 $imports_dir = @ opendir($import_root); 63 63 if ($imports_dir) { 64 64 while (($file = readdir($imports_dir)) !== false) { 65 if ($file {0}== '.') {65 if ($file[0] == '.') { 66 66 continue; 67 67 } elseif (substr($file, -4) == '.php') { 68 68 require_once($import_root . '/' . $file); -
wp-includes/class-json.php
153 153 return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); 154 154 } 155 155 156 $bytes = (ord($utf16 {0}) << 8) | ord($utf16{1});156 $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]); 157 157 158 158 switch(true) { 159 159 case ((0x7F & $bytes) == $bytes): … … 206 206 case 2: 207 207 // return a UTF-16 character from a 2-byte UTF-8 char 208 208 // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 209 return chr(0x07 & (ord($utf8 {0}) >> 2))210 . chr((0xC0 & (ord($utf8 {0}) << 6))211 | (0x3F & ord($utf8 {1})));209 return chr(0x07 & (ord($utf8[0]) >> 2)) 210 . chr((0xC0 & (ord($utf8[0]) << 6)) 211 | (0x3F & ord($utf8[1]))); 212 212 213 213 case 3: 214 214 // return a UTF-16 character from a 3-byte UTF-8 char 215 215 // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 216 return chr((0xF0 & (ord($utf8 {0}) << 4))217 | (0x0F & (ord($utf8 {1}) >> 2)))218 . chr((0xC0 & (ord($utf8 {1}) << 6))219 | (0x7F & ord($utf8 {2})));216 return chr((0xF0 & (ord($utf8[0]) << 4)) 217 | (0x0F & (ord($utf8[1]) >> 2))) 218 . chr((0xC0 & (ord($utf8[1]) << 6)) 219 | (0x7F & ord($utf8[2]))); 220 220 } 221 221 222 222 // ignoring UTF-32 for now, sorry … … 293 293 */ 294 294 for ($c = 0; $c < $strlen_var; ++$c) { 295 295 296 $ord_var_c = ord($var {$c});296 $ord_var_c = ord($var[$c]); 297 297 298 298 switch (true) { 299 299 case $ord_var_c == 0x08: … … 316 316 case $ord_var_c == 0x2F: 317 317 case $ord_var_c == 0x5C: 318 318 // double quote, slash, slosh 319 $ascii .= '\\'.$var {$c};319 $ascii .= '\\'.$var[$c]; 320 320 break; 321 321 322 322 case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): 323 323 // characters U-00000000 - U-0000007F (same as ASCII) 324 $ascii .= $var {$c};324 $ascii .= $var[$c]; 325 325 break; 326 326 327 327 case (($ord_var_c & 0xE0) == 0xC0): … … 333 333 break; 334 334 } 335 335 336 $char = pack('C*', $ord_var_c, ord($var {$c + 1}));336 $char = pack('C*', $ord_var_c, ord($var[$c + 1])); 337 337 $c += 1; 338 338 $utf16 = $this->utf82utf16($char); 339 339 $ascii .= sprintf('\u%04s', bin2hex($utf16)); … … 348 348 // characters U-00000800 - U-0000FFFF, mask 1110XXXX 349 349 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 350 350 $char = pack('C*', $ord_var_c, 351 @ord($var {$c + 1}),352 @ord($var {$c + 2}));351 @ord($var[$c + 1]), 352 @ord($var[$c + 2])); 353 353 $c += 2; 354 354 $utf16 = $this->utf82utf16($char); 355 355 $ascii .= sprintf('\u%04s', bin2hex($utf16)); … … 364 364 // characters U-00010000 - U-001FFFFF, mask 11110XXX 365 365 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 366 366 $char = pack('C*', $ord_var_c, 367 ord($var {$c + 1}),368 ord($var {$c + 2}),369 ord($var {$c + 3}));367 ord($var[$c + 1]), 368 ord($var[$c + 2]), 369 ord($var[$c + 3])); 370 370 $c += 3; 371 371 $utf16 = $this->utf82utf16($char); 372 372 $ascii .= sprintf('\u%04s', bin2hex($utf16)); … … 381 381 break; 382 382 } 383 383 $char = pack('C*', $ord_var_c, 384 ord($var {$c + 1}),385 ord($var {$c + 2}),386 ord($var {$c + 3}),387 ord($var {$c + 4}));384 ord($var[$c + 1]), 385 ord($var[$c + 2]), 386 ord($var[$c + 3]), 387 ord($var[$c + 4])); 388 388 $c += 4; 389 389 $utf16 = $this->utf82utf16($char); 390 390 $ascii .= sprintf('\u%04s', bin2hex($utf16)); … … 399 399 // characters U-04000000 - U-7FFFFFFF, mask 1111110X 400 400 // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 401 401 $char = pack('C*', $ord_var_c, 402 ord($var {$c + 1}),403 ord($var {$c + 2}),404 ord($var {$c + 3}),405 ord($var {$c + 4}),406 ord($var {$c + 5}));402 ord($var[$c + 1]), 403 ord($var[$c + 2]), 404 ord($var[$c + 3]), 405 ord($var[$c + 4]), 406 ord($var[$c + 5])); 407 407 $c += 5; 408 408 $utf16 = $this->utf82utf16($char); 409 409 $ascii .= sprintf('\u%04s', bin2hex($utf16)); … … 577 577 for ($c = 0; $c < $strlen_chrs; ++$c) { 578 578 579 579 $substr_chrs_c_2 = substr($chrs, $c, 2); 580 $ord_chrs_c = ord($chrs {$c});580 $ord_chrs_c = ord($chrs[$c]); 581 581 582 582 switch (true) { 583 583 case $substr_chrs_c_2 == '\b': … … 607 607 case $substr_chrs_c_2 == '\\/': 608 608 if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || 609 609 ($delim == "'" && $substr_chrs_c_2 != '\\"')) { 610 $utf8 .= $chrs {++$c};610 $utf8 .= $chrs[++$c]; 611 611 } 612 612 break; 613 613 … … 620 620 break; 621 621 622 622 case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): 623 $utf8 .= $chrs {$c};623 $utf8 .= $chrs[$c]; 624 624 break; 625 625 626 626 case ($ord_chrs_c & 0xE0) == 0xC0: … … 667 667 } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { 668 668 // array, or object notation 669 669 670 if ($str {0}== '[') {670 if ($str[0] == '[') { 671 671 $stk = array(SERVICES_JSON_IN_ARR); 672 672 $arr = array(); 673 673 } else { … … 706 706 $top = end($stk); 707 707 $substr_chrs_c_2 = substr($chrs, $c, 2); 708 708 709 if (($c == $strlen_chrs) || (($chrs {$c}== ',') && ($top['what'] == SERVICES_JSON_SLICE))) {709 if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { 710 710 // found a comma that is not inside a string, array, etc., 711 711 // OR we've reached the end of the character list 712 712 $slice = substr($chrs, $top['where'], ($c - $top['where'])); … … 748 748 749 749 } 750 750 751 } elseif ((($chrs {$c} == '"') || ($chrs{$c}== "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {751 } elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { 752 752 // found a quote, and we are not inside a string 753 array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs {$c}));753 array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c])); 754 754 //print("Found start of string at {$c}\n"); 755 755 756 } elseif (($chrs {$c}== $top['delim']) &&756 } elseif (($chrs[$c] == $top['delim']) && 757 757 ($top['what'] == SERVICES_JSON_IN_STR) && 758 758 ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { 759 759 // found a quote, we're in a string, and it's not escaped … … 762 762 array_pop($stk); 763 763 //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); 764 764 765 } elseif (($chrs {$c}== '[') &&765 } elseif (($chrs[$c] == '[') && 766 766 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { 767 767 // found a left-bracket, and we are in an array, object, or slice 768 768 array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); 769 769 //print("Found start of array at {$c}\n"); 770 770 771 } elseif (($chrs {$c}== ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {771 } elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { 772 772 // found a right-bracket, and we're in an array 773 773 array_pop($stk); 774 774 //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); 775 775 776 } elseif (($chrs {$c}== '{') &&776 } elseif (($chrs[$c] == '{') && 777 777 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { 778 778 // found a left-brace, and we are in an array, object, or slice 779 779 array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); 780 780 //print("Found start of object at {$c}\n"); 781 781 782 } elseif (($chrs {$c}== '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {782 } elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { 783 783 // found a right-brace, and we're in an object 784 784 array_pop($stk); 785 785 //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); -
wp-includes/class-pop3.php
367 367 $line = fgets($fp,$buffer); 368 368 while ( !ereg("^\.\r\n",$line)) 369 369 { 370 if ( $line {0}== '.' ) { $line = substr($line,1); }370 if ( $line[0] == '.' ) { $line = substr($line,1); } 371 371 $MsgArray[$count] = $line; 372 372 $count++; 373 373 $line = fgets($fp,$buffer); -
wp-includes/formatting.php
73 73 for ( $i = 0; $i < $stop; $i++ ) { 74 74 $curl = $textarr[$i]; 75 75 76 if ( !empty($curl) && '<' != $curl {0} && '[' != $curl{0}76 if ( !empty($curl) && '<' != $curl[0] && '[' != $curl[0] 77 77 && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { 78 78 // This is not a tag, nor is the texturization disabled 79 79 // static strings … … 85 85 * Only call _wptexturize_pushpop_element if first char is correct 86 86 * tag opening 87 87 */ 88 if ('<' == $curl {0})88 if ('<' == $curl[0]) 89 89 _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); 90 elseif ('[' == $curl {0})90 elseif ('[' == $curl[0]) 91 91 _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); 92 92 } 93 93 … … 1456 1456 $stop = count($textarr);// loop stuff 1457 1457 for ($i = 0; $i < $stop; $i++) { 1458 1458 $content = $textarr[$i]; 1459 if ((strlen($content) > 0) && ('<' != $content {0})) { // If it's not a tag1459 if ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag 1460 1460 $content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content); 1461 1461 } 1462 1462 $output .= $content; … … 2579 2579 $fragment = substr($pattern, $start, $end - $start); 2580 2580 2581 2581 // Fragment has a specifier 2582 if ( $pattern {$start}== '%' ) {2582 if ( $pattern[$start] == '%' ) { 2583 2583 // Find numbered arguments or take the next one in order 2584 2584 if ( preg_match('/^%(\d+)\$/', $fragment, $matches) ) { 2585 2585 $arg = isset($args[$matches[1]]) ? $args[$matches[1]] : ''; -
wp-includes/functions.php
2058 2058 if ( realpath($path) == $path ) 2059 2059 return true; 2060 2060 2061 if ( strlen($path) == 0 || $path {0}== '.' )2061 if ( strlen($path) == 0 || $path[0] == '.' ) 2062 2062 return false; 2063 2063 2064 2064 // windows allows absolute paths like this -
wp-includes/pluggable.php
1646 1646 $host = 'https://secure.gravatar.com'; 1647 1647 } else { 1648 1648 if ( !empty($email) ) 1649 $host = sprintf( "http://%d.gravatar.com", ( hexdec( $email_hash {0}) % 2 ) );1649 $host = sprintf( "http://%d.gravatar.com", ( hexdec( $email_hash[0] ) % 2 ) ); 1650 1650 else 1651 1651 $host = 'http://0.gravatar.com'; 1652 1652 } -
wp-includes/post-template.php
684 684 echo "<ul class='post-meta'>\n"; 685 685 foreach ( (array) $keys as $key ) { 686 686 $keyt = trim($key); 687 if ( '_' == $keyt {0})687 if ( '_' == $keyt[0] ) 688 688 continue; 689 689 $values = array_map('trim', get_post_custom_values($key)); 690 690 $value = implode($values,', '); -
wp-includes/rewrite.php
34 34 */ 35 35 function add_rewrite_tag($tagname, $regex) { 36 36 //validation 37 if ( strlen($tagname) < 3 || $tagname {0} != '%' || $tagname{strlen($tagname)-1}!= '%' )37 if ( strlen($tagname) < 3 || $tagname[0] != '%' || $tagname[strlen($tagname)-1] != '%' ) 38 38 return; 39 39 40 40 $qv = trim($tagname, '%'); -
wp-includes/taxonomy.php
1084 1084 * @param int|string $term The term to check 1085 1085 * @param string $taxonomy The taxonomy name to use 1086 1086 * @param int $parent ID of parent term under which to confine the exists search. 1087 * @return mixed Get the term id or Term Object, if exists .1087 * @return mixed Get the term id or Term Object, if exists 1088 1088 */ 1089 1089 function term_exists($term, $taxonomy = '', $parent = 0) { 1090 1090 global $wpdb; -
wp-includes/theme.php
588 588 589 589 while ( ($theme_dir = readdir($themes_dir)) !== false ) { 590 590 if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { 591 if ( $theme_dir {0}== '.' || $theme_dir == 'CVS' )591 if ( $theme_dir[0] == '.' || $theme_dir == 'CVS' ) 592 592 continue; 593 593 594 594 $stylish_dir = @opendir($theme_root . '/' . $theme_dir); … … 611 611 $found_subdir_themes = false; 612 612 while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) { 613 613 if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) { 614 if ( $theme_subdir {0}== '.' || $theme_subdir == 'CVS' )614 if ( $theme_subdir[0] == '.' || $theme_subdir == 'CVS' ) 615 615 continue; 616 616 617 617 $stylish_dir = @opendir($subdir . '/' . $theme_subdir);