In `wp-includes/functions.php`, remove dead code:
* In `current_time()`, `break` is unreachable after `return`. * In `add_query_arg()`, `$ret` is set twice before being used. * In `wp_mkdir_p()`, `$dir_perms` is set twice before being used. See #27882. Built from https://develop.svn.wordpress.org/trunk@28325 git-svn-id: http://core.svn.wordpress.org/trunk@28153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7eeafa3537
commit
de4eaacd89
|
@ -61,13 +61,10 @@ function current_time( $type, $gmt = 0 ) {
|
||||||
switch ( $type ) {
|
switch ( $type ) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );
|
return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );
|
||||||
break;
|
|
||||||
case 'timestamp':
|
case 'timestamp':
|
||||||
return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
|
return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return ( $gmt ) ? date( $type ) : date( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) );
|
return ( $gmt ) ? date( $type ) : date( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) );
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,7 +689,6 @@ function _http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=t
|
||||||
* @return string New URL query string.
|
* @return string New URL query string.
|
||||||
*/
|
*/
|
||||||
function add_query_arg() {
|
function add_query_arg() {
|
||||||
$ret = '';
|
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
if ( is_array( $args[0] ) ) {
|
if ( is_array( $args[0] ) ) {
|
||||||
if ( count( $args ) < 2 || false === $args[1] )
|
if ( count( $args ) < 2 || false === $args[1] )
|
||||||
|
@ -1427,7 +1423,6 @@ function wp_mkdir_p( $target ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the permission bits.
|
// Get the permission bits.
|
||||||
$dir_perms = false;
|
|
||||||
if ( $stat = @stat( $target_parent ) ) {
|
if ( $stat = @stat( $target_parent ) ) {
|
||||||
$dir_perms = $stat['mode'] & 0007777;
|
$dir_perms = $stat['mode'] & 0007777;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue