Ticket #35899: 35899.diff
| File 35899.diff, 10.7 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/class-wp-filesystem-base.php
566 566 * @access public 567 567 * @since 2.5.0 568 568 * @abstract 569 * 569 * 570 570 * @param string $file Path to the file. 571 571 * @return string|bool Username of the user or false on error. 572 572 */ -
src/wp-admin/includes/class-wp-filesystem-ftpext.php
120 120 unlink( $tempfile ); 121 121 return false; 122 122 } 123 123 124 124 if ( ! @ftp_fget( $this->link, $temp, $file, FTP_BINARY ) ) { 125 125 fclose( $temp ); 126 126 unlink( $tempfile ); 127 127 return false; 128 128 } 129 129 130 130 fseek( $temp, 0 ); // Skip back to the start of the file being written to 131 131 $contents = ''; 132 132 -
src/wp-admin/includes/class-wp-filesystem-ssh2.php
183 183 184 184 /** 185 185 * @access public 186 * 186 * 187 187 * @param string $command 188 188 * @param bool $returnbool 189 189 * @return bool|string -
src/wp-admin/includes/network.php
159 159 $subdomain_install = true; 160 160 } else { 161 161 $subdomain_install = false; 162 if ( $got_mod_rewrite = got_mod_rewrite() ) { // dangerous assumptions 162 if ( $got_mod_rewrite = got_mod_rewrite() ) { // dangerous assumptions 163 163 echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> '; 164 164 /* translators: %s: mod_rewrite */ 165 165 printf( __( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ), -
src/wp-admin/nav-menus.php
51 51 52 52 /* 53 53 * If a JSON blob of navigation menu data is found, expand it and inject it 54 * into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134. 54 * into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134. 55 55 */ 56 56 if ( isset( $_POST['nav-menu-data'] ) ) { 57 57 $data = json_decode( stripslashes( $_POST['nav-menu-data'] ) ); -
src/wp-admin/theme-editor.php
229 229 230 230 echo "\t<ul>\n"; 231 231 } 232 232 233 233 $file_description = get_file_description( $filename ); 234 234 if ( $filename !== basename( $absolute_filename ) || $file_description !== $filename ) { 235 235 $file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>'; -
src/wp-includes/class-feed.php
27 27 28 28 /** 29 29 * Class instantiator. 30 * 30 * 31 31 * @param string $location URL location (scheme is used to determine handler). 32 32 * @param string $filename Unique identifier for cache object. 33 33 * @param string $extension 'spi' or 'spc'. -
src/wp-includes/class-json.php
135 135 * bubble up with an error, so all return values 136 136 * from encode() should be checked with isError() 137 137 * - SERVICES_JSON_USE_TO_JSON: call toJSON when serializing objects 138 * It serializes the return value from the toJSON call rather 139 * than the object itself, toJSON can return associative arrays, 138 * It serializes the return value from the toJSON call rather 139 * than the object itself, toJSON can return associative arrays, 140 140 * strings or numbers, if you return an object, make sure it does 141 141 * not have a toJSON method, otherwise an error will occur. 142 142 */ … … 158 158 var $_mb_strlen = false; 159 159 var $_mb_substr = false; 160 160 var $_mb_convert_encoding = false; 161 161 162 162 /** 163 163 * convert a string from one UTF-16 char to one UTF-8 char 164 164 * … … 282 282 $ret = $this->_encode($var); 283 283 setlocale(LC_NUMERIC, $lc); 284 284 return $ret; 285 286 285 } 287 286 /** 288 * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format 287 * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format 289 288 * 290 289 * @param mixed $var any number, boolean, string, array, or object to be encoded. 291 290 * see argument 1 to Services_JSON() above for array-parsing behavior. … … 295 294 * @return mixed JSON string representation of input var or an error if a problem occurs 296 295 * @access public 297 296 */ 298 function _encode($var) 297 function _encode($var) 299 298 { 300 301 299 switch (gettype($var)) { 302 300 case 'boolean': 303 301 return $var ? 'true' : 'false'; … … 362 360 $ascii .= '?'; 363 361 break; 364 362 } 365 363 366 364 $char = pack('C*', $ord_var_c, ord($var{$c + 1})); 367 365 $c += 1; 368 366 $utf16 = $this->utf82utf16($char); … … 488 486 return '[' . join(',', $elements) . ']'; 489 487 490 488 case 'object': 491 489 492 490 // support toJSON methods. 493 491 if (($this->use & SERVICES_JSON_USE_TO_JSON) && method_exists($var, 'toJSON')) { 494 492 // this may end up allowing unlimited recursion 495 493 // so we check the return value to make sure it's not got the same method. 496 494 $recode = $var->toJSON(); 497 495 498 496 if (method_exists($recode, 'toJSON')) { 499 497 500 498 return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) 501 499 ? 'null' 502 500 : new Services_JSON_Error(get_class($var). 503 501 " toJSON returned an object with a toJSON method."); 504 502 505 503 } 506 504 507 505 return $this->_encode( $recode ); 508 } 509 506 } 507 510 508 $vars = get_object_vars($var); 511 509 512 510 $properties = array_map(array($this, 'name_value'), 513 511 array_keys($vars), 514 512 array_values($vars)); … … 772 770 // element in an associative array, 773 771 // for now 774 772 $parts = array(); 775 776 if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:/Uis', $slice, $parts)) {773 774 if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:/Uis', $slice, $parts)) { 777 775 // "name":value pair 778 776 $key = $this->decode($parts[1]); 779 777 $val = $this->decode(trim(substr($slice, strlen($parts[0])), ", \t\n\r\0\x0B")); … … 879 877 880 878 return false; 881 879 } 882 880 883 881 /** 884 882 * Calculates length of string in bytes 885 * @param string 883 * @param string 886 884 * @return integer length 887 885 */ 888 function strlen8( $str ) 886 function strlen8( $str ) 889 887 { 890 888 if ( $this->_mb_strlen ) { 891 889 return mb_strlen( $str, "8bit" ); … … 892 890 } 893 891 return strlen( $str ); 894 892 } 895 893 896 894 /** 897 895 * Returns part of a string, interpreting $start and $length as number of bytes. 898 * @param string 899 * @param integer start 900 * @param integer length 896 * @param string 897 * @param integer start 898 * @param integer length 901 899 * @return integer length 902 900 */ 903 function substr8( $string, $start, $length=false ) 901 function substr8( $string, $start, $length=false ) 904 902 { 905 903 if ( $length === false ) { 906 904 $length = $this->strlen8( $string ) - $start; … … 954 952 self::__construct( $message, $code, $mode, $options, $userinfo ); 955 953 } 956 954 } 957 955 958 956 } 959 957 960 958 endif; -
src/wp-includes/class-wp-walker.php
386 386 * 387 387 * @since 2.7.0 388 388 * @access public 389 * 389 * 390 390 * @param array $elements Elements to list. 391 391 * @return int Number of root elements. 392 392 */ -
src/wp-includes/kses.php
550 550 $allowed_protocols = wp_allowed_protocols(); 551 551 $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) ); 552 552 $string = wp_kses_js_entities( $string ); 553 553 554 554 // Preserve leading and trailing whitespace. 555 555 $matches = array(); 556 556 preg_match('/^\s*/', $string, $matches); … … 562 562 } else { 563 563 $string = substr( $string, strlen( $lead ), -strlen( $trail ) ); 564 564 } 565 565 566 566 // Parse attribute name and value from input. 567 567 $split = preg_split( '/\s*=\s*/', $string, 2 ); 568 568 $name = $split[0]; … … 599 599 $value = ''; 600 600 $vless = 'y'; 601 601 } 602 602 603 603 // Sanitize attribute by name. 604 604 wp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html ); 605 605 … … 1062 1062 } else { 1063 1063 $xhtml_slash = ''; 1064 1064 } 1065 1065 1066 1066 // Split it 1067 1067 $attrarr = wp_kses_hair_parse( $attr ); 1068 1068 if ( false === $attrarr ) { … … 1072 1072 // Make sure all input is returned by adding front and back matter. 1073 1073 array_unshift( $attrarr, $begin . $slash . $elname ); 1074 1074 array_push( $attrarr, $xhtml_slash . $end ); 1075 1075 1076 1076 return $attrarr; 1077 1077 } 1078 1078