Avoid E_STRICT notices. see #18975

git-svn-id: https://develop.svn.wordpress.org/trunk@19094 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-10-31 19:38:46 +00:00
parent a5c6da9a2e
commit 4399cf7610
5 changed files with 21 additions and 15 deletions

View File

@ -346,7 +346,7 @@ class WP_Http {
* @return array Processed string headers. If duplicate headers are encountered, * @return array Processed string headers. If duplicate headers are encountered,
* Then a numbered array is returned as the value of that header-key. * 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 // split headers, one per array element
if ( is_string($headers) ) { if ( is_string($headers) ) {
// tolerate line terminator: CRLF = LF (RFC 2616 19.3) // 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() * @param array $r Full array of args passed into ::request()
*/ */
function buildCookieHeader( &$r ) { public static function buildCookieHeader( &$r ) {
if ( ! empty($r['cookies']) ) { if ( ! empty($r['cookies']) ) {
$cookies_header = ''; $cookies_header = '';
foreach ( (array) $r['cookies'] as $cookie ) { foreach ( (array) $r['cookies'] as $cookie ) {
@ -756,7 +756,7 @@ class WP_Http_Fsockopen {
* @static * @static
* @return boolean False means this class can not be used, true means it can. * @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' ) ) if ( ! function_exists( 'fsockopen' ) )
return false; return false;
@ -939,7 +939,7 @@ class WP_Http_Streams {
* *
* @return boolean False means this class can not be used, true means it can. * @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' ) ) if ( ! function_exists( 'fopen' ) )
return false; return false;
@ -1166,7 +1166,7 @@ class WP_Http_Curl {
* *
* @return boolean False means this class can not be used, true means it can. * @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' ) ) if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) )
return false; 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. * @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. * @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 ); return gzdeflate( $raw, $level );
} }
@ -1598,7 +1598,7 @@ class WP_Http_Encoding {
* @param int $length The optional length of the compressed data. * @param int $length The optional length of the compressed data.
* @return string|bool False on failure. * @return string|bool False on failure.
*/ */
function decompress( $compressed, $length = null ) { public static function decompress( $compressed, $length = null ) {
if ( empty($compressed) ) if ( empty($compressed) )
return $compressed; return $compressed;
@ -1642,7 +1642,7 @@ class WP_Http_Encoding {
* @param string $gzData String to decompress. * @param string $gzData String to decompress.
* @return string|bool False on failure. * @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() // Compressed data might contain a full header, if so strip it for gzinflate()
if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) { if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
@ -1680,7 +1680,7 @@ class WP_Http_Encoding {
* *
* @return string Types of encoding to accept. * @return string Types of encoding to accept.
*/ */
function accept_encoding() { public static function accept_encoding() {
$type = array(); $type = array();
if ( function_exists( 'gzinflate' ) ) if ( function_exists( 'gzinflate' ) )
$type[] = 'deflate;q=1.0'; $type[] = 'deflate;q=1.0';
@ -1701,7 +1701,7 @@ class WP_Http_Encoding {
* *
* @return string Content-Encoding string to send in the header. * @return string Content-Encoding string to send in the header.
*/ */
function content_encoding() { public static function content_encoding() {
return 'deflate'; return 'deflate';
} }
@ -1713,7 +1713,7 @@ class WP_Http_Encoding {
* @param array|string $headers All of the available headers. * @param array|string $headers All of the available headers.
* @return bool * @return bool
*/ */
function should_decode($headers) { public static function should_decode($headers) {
if ( is_array( $headers ) ) { if ( is_array( $headers ) ) {
if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) ) if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
return true; return true;
@ -1735,7 +1735,7 @@ class WP_Http_Encoding {
* *
* @return bool * @return bool
*/ */
function is_available() { public static function is_available() {
return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') ); return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') );
} }
} }

View File

@ -572,7 +572,7 @@ class WP_MatchesMapRegex {
* @param array $matches data used for substitution * @param array $matches data used for substitution
* @return string * @return string
*/ */
function apply($subject, $matches) { public static function apply($subject, $matches) {
$oSelf = new WP_MatchesMapRegex($subject, $matches); $oSelf = new WP_MatchesMapRegex($subject, $matches);
return $oSelf->output; return $oSelf->output;
} }

View File

@ -1621,7 +1621,8 @@ function feed_links_extra( $args = array() ) {
$args = wp_parse_args( $args, $defaults ); $args = wp_parse_args( $args, $defaults );
if ( is_single() || is_page() ) { 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 ) { 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() ) )); $title = esc_attr(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) ));

View File

@ -134,6 +134,10 @@ function get_current_site_name( $current_site ) {
*/ */
function wpmu_current_site() { function wpmu_current_site() {
global $wpdb, $current_site, $domain, $path, $sites, $cookie_domain; 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' ) ) { if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) {
$current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1;
$current_site->domain = DOMAIN_CURRENT_SITE; $current_site->domain = DOMAIN_CURRENT_SITE;

View File

@ -4027,7 +4027,8 @@ function wp_mime_type_icon( $mime = 0 ) {
$dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) ); $dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) );
$icon_files = array(); $icon_files = array();
while ( $dirs ) { while ( $dirs ) {
$dir = array_shift($keys = array_keys($dirs)); $keys = array_keys( $dirs );
$dir = array_shift( $keys );
$uri = array_shift($dirs); $uri = array_shift($dirs);
if ( $dh = opendir($dir) ) { if ( $dh = opendir($dir) ) {
while ( false !== $file = readdir($dh) ) { while ( false !== $file = readdir($dh) ) {