diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index cd8bbef981..a68711c8cd 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -346,7 +346,7 @@ class WP_Http { * @return array Processed string headers. If duplicate headers are encountered, * Then a numbered array is returned as the value of that header-key. */ - function processHeaders($headers) { + public static function processHeaders($headers) { // split headers, one per array element if ( is_string($headers) ) { // tolerate line terminator: CRLF = LF (RFC 2616 19.3) @@ -413,7 +413,7 @@ class WP_Http { * * @param array $r Full array of args passed into ::request() */ - function buildCookieHeader( &$r ) { + public static function buildCookieHeader( &$r ) { if ( ! empty($r['cookies']) ) { $cookies_header = ''; foreach ( (array) $r['cookies'] as $cookie ) { @@ -756,7 +756,7 @@ class WP_Http_Fsockopen { * @static * @return boolean False means this class can not be used, true means it can. */ - function test( $args = array() ) { + public static function test( $args = array() ) { if ( ! function_exists( 'fsockopen' ) ) return false; @@ -939,7 +939,7 @@ class WP_Http_Streams { * * @return boolean False means this class can not be used, true means it can. */ - function test( $args = array() ) { + public static function test( $args = array() ) { if ( ! function_exists( 'fopen' ) ) return false; @@ -1166,7 +1166,7 @@ class WP_Http_Curl { * * @return boolean False means this class can not be used, true means it can. */ - function test( $args = array() ) { + public static function test( $args = array() ) { if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) ) return false; @@ -1580,7 +1580,7 @@ class WP_Http_Encoding { * @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports. * @return string|bool False on failure. */ - function compress( $raw, $level = 9, $supports = null ) { + public static function compress( $raw, $level = 9, $supports = null ) { return gzdeflate( $raw, $level ); } @@ -1598,7 +1598,7 @@ class WP_Http_Encoding { * @param int $length The optional length of the compressed data. * @return string|bool False on failure. */ - function decompress( $compressed, $length = null ) { + public static function decompress( $compressed, $length = null ) { if ( empty($compressed) ) return $compressed; @@ -1642,7 +1642,7 @@ class WP_Http_Encoding { * @param string $gzData String to decompress. * @return string|bool False on failure. */ - function compatible_gzinflate($gzData) { + public static function compatible_gzinflate($gzData) { // Compressed data might contain a full header, if so strip it for gzinflate() if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) { @@ -1680,7 +1680,7 @@ class WP_Http_Encoding { * * @return string Types of encoding to accept. */ - function accept_encoding() { + public static function accept_encoding() { $type = array(); if ( function_exists( 'gzinflate' ) ) $type[] = 'deflate;q=1.0'; @@ -1701,7 +1701,7 @@ class WP_Http_Encoding { * * @return string Content-Encoding string to send in the header. */ - function content_encoding() { + public static function content_encoding() { return 'deflate'; } @@ -1713,7 +1713,7 @@ class WP_Http_Encoding { * @param array|string $headers All of the available headers. * @return bool */ - function should_decode($headers) { + public static function should_decode($headers) { if ( is_array( $headers ) ) { if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) ) return true; @@ -1735,7 +1735,7 @@ class WP_Http_Encoding { * * @return bool */ - function is_available() { + public static function is_available() { return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') ); } } diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index d136f08885..1540423929 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -572,7 +572,7 @@ class WP_MatchesMapRegex { * @param array $matches data used for substitution * @return string */ - function apply($subject, $matches) { + public static function apply($subject, $matches) { $oSelf = new WP_MatchesMapRegex($subject, $matches); return $oSelf->output; } diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index b09d2fe8e3..e875422898 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1621,7 +1621,8 @@ function feed_links_extra( $args = array() ) { $args = wp_parse_args( $args, $defaults ); if ( is_single() || is_page() ) { - $post = &get_post( $id = 0 ); + $id = 0; + $post = &get_post( $id ); if ( comments_open() || pings_open() || $post->comment_count > 0 ) { $title = esc_attr(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) )); diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index 797d606110..3343903810 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -134,6 +134,10 @@ function get_current_site_name( $current_site ) { */ function wpmu_current_site() { global $wpdb, $current_site, $domain, $path, $sites, $cookie_domain; + + if ( empty( $current_site ) ) + $current_site = new stdClass; + if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) { $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; $current_site->domain = DOMAIN_CURRENT_SITE; diff --git a/wp-includes/post.php b/wp-includes/post.php index 4ab61c2b7d..19472912d1 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4027,7 +4027,8 @@ function wp_mime_type_icon( $mime = 0 ) { $dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) ); $icon_files = array(); while ( $dirs ) { - $dir = array_shift($keys = array_keys($dirs)); + $keys = array_keys( $dirs ); + $dir = array_shift( $keys ); $uri = array_shift($dirs); if ( $dh = opendir($dir) ) { while ( false !== $file = readdir($dh) ) {