mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-06 00:18:45 +01:00
Avoid E_STRICT notices. see #18975
git-svn-id: http://svn.automattic.com/wordpress/trunk@19094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c2064f9976
commit
28b1b4763d
@ -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') );
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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() ) ));
|
||||
|
@ -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;
|
||||
|
@ -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) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user