Changeset 16340
- Timestamp:
- 11/13/2010 09:53:55 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import.php
r16008 r16340 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') { -
trunk/wp-admin/includes/media.php
r16245 r16340 1259 1259 1260 1260 foreach ( $form_fields as $id => $field ) { 1261 if ( $id {0}== '_' )1261 if ( $id[0] == '_' ) 1262 1262 continue; 1263 1263 -
trunk/wp-admin/includes/misc.php
r16298 r16340 577 577 */ 578 578 579 if ( $path {strlen($path)-1}== '/' ) // recursively return a temporary file path579 if ( $path[strlen($path)-1] == '/' ) // recursively return a temporary file path 580 580 return win_is_writable($path . uniqid(mt_rand()) . '.tmp'); 581 581 else if ( is_dir($path) ) -
trunk/wp-includes/class-json.php
r12705 r16340 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) { … … 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 … … 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) { … … 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 … … 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); … … 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); … … 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); … … 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); … … 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); … … 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) { … … 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; … … 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 … … 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(); … … 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 … … 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)) { … … 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 … … 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 … … 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); -
trunk/wp-includes/class-pop3.php
r9503 r16340 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++; -
trunk/wp-includes/formatting.php
r16313 r16340 93 93 $curl = $textarr[$i]; 94 94 95 if ( !empty($curl) && '<' != $curl {0} && '[' != $curl{0}95 if ( !empty($curl) && '<' != $curl[0] && '[' != $curl[0] 96 96 && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { 97 97 // This is not a tag, nor is the texturization disabled … … 114 114 * tag opening 115 115 */ 116 if ('<' == $curl {0})116 if ('<' == $curl[0]) 117 117 _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); 118 elseif ('[' == $curl {0})118 elseif ('[' == $curl[0]) 119 119 _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); 120 120 } … … 1499 1499 for ($i = 0; $i < $stop; $i++) { 1500 1500 $content = $textarr[$i]; 1501 if ((strlen($content) > 0) && ('<' != $content {0})) { // If it's not a tag1501 if ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag 1502 1502 $content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content); 1503 1503 } … … 2633 2633 2634 2634 // Fragment has a specifier 2635 if ( $pattern {$start}== '%' ) {2635 if ( $pattern[$start] == '%' ) { 2636 2636 // Find numbered arguments or take the next one in order 2637 2637 if ( preg_match('/^%(\d+)\$/', $fragment, $matches) ) { -
trunk/wp-includes/functions.php
r16303 r16340 2082 2082 return true; 2083 2083 2084 if ( strlen($path) == 0 || $path {0}== '.' )2084 if ( strlen($path) == 0 || $path[0] == '.' ) 2085 2085 return false; 2086 2086 -
trunk/wp-includes/pluggable.php
r16304 r16340 1659 1659 } else { 1660 1660 if ( !empty($email) ) 1661 $host = sprintf( "http://%d.gravatar.com", ( hexdec( $email_hash {0}) % 2 ) );1661 $host = sprintf( "http://%d.gravatar.com", ( hexdec( $email_hash[0] ) % 2 ) ); 1662 1662 else 1663 1663 $host = 'http://0.gravatar.com'; -
trunk/wp-includes/post-template.php
r16334 r16340 728 728 foreach ( (array) $keys as $key ) { 729 729 $keyt = trim($key); 730 if ( '_' == $keyt {0})730 if ( '_' == $keyt[0] ) 731 731 continue; 732 732 $values = array_map('trim', get_post_custom_values($key)); -
trunk/wp-includes/rewrite.php
r16069 r16340 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 -
trunk/wp-includes/theme.php
r16174 r16340 598 598 while ( ($theme_dir = readdir($themes_dir)) !== false ) { 599 599 if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { 600 if ( $theme_dir {0}== '.' || $theme_dir == 'CVS' )600 if ( $theme_dir[0] == '.' || $theme_dir == 'CVS' ) 601 601 continue; 602 602 … … 621 621 while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) { 622 622 if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) { 623 if ( $theme_subdir {0}== '.' || $theme_subdir == 'CVS' )623 if ( $theme_subdir[0] == '.' || $theme_subdir == 'CVS' ) 624 624 continue; 625 625
Note: See TracChangeset
for help on using the changeset viewer.