Changeset 47219 for trunk/src/wp-includes/functions.php
- Timestamp:
- 02/09/2020 04:52:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r47212 r47219 687 687 } elseif ( ';' !== substr( $data, -1 ) ) { 688 688 return false; 689 } elseif ( $data[0] !== 's') {689 } elseif ( 's' !== $data[0] ) { 690 690 return false; 691 691 } elseif ( '"' !== substr( $data, -2, 1 ) ) { … … 1014 1014 $k = urlencode( $k ); 1015 1015 } 1016 if ( is_int( $k ) && $prefix != null) {1016 if ( is_int( $k ) && null != $prefix ) { 1017 1017 $k = $prefix . $k; 1018 1018 } … … 1020 1020 $k = $key . '%5B' . $k . '%5D'; 1021 1021 } 1022 if ( $v === null) {1022 if ( null === $v ) { 1023 1023 continue; 1024 } elseif ( $v === false) {1024 } elseif ( false === $v ) { 1025 1025 $v = '0'; 1026 1026 } … … 1133 1133 1134 1134 foreach ( $qs as $k => $v ) { 1135 if ( $v === false) {1135 if ( false === $v ) { 1136 1136 unset( $qs[ $k ] ); 1137 1137 } … … 1540 1540 $feed = preg_replace( '/^_+/', '', $feed ); 1541 1541 1542 if ( $feed == '' || $feed == 'feed') {1542 if ( '' == $feed || 'feed' === $feed ) { 1543 1543 $feed = get_default_feed(); 1544 1544 } … … 1886 1886 $ref = wp_get_raw_referer(); 1887 1887 1888 if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) && $ref !== home_url() . wp_unslash( $_SERVER['REQUEST_URI'] )) {1888 if ( $ref && wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref && home_url() . wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref ) { 1889 1889 return wp_validate_redirect( $ref, false ); 1890 1890 } … … 1948 1948 1949 1949 // Put the wrapper back on the target. 1950 if ( $wrapper !== null) {1950 if ( null !== $wrapper ) { 1951 1951 $target = $wrapper . '://' . $target; 1952 1952 } … … 1990 1990 * the $dir_perms correctly with chmod() 1991 1991 */ 1992 if ( $dir_perms != ( $dir_perms & ~umask() )) {1992 if ( ( $dir_perms & ~umask() ) != $dir_perms ) { 1993 1993 $folder_parts = explode( '/', substr( $target, strlen( $target_parent ) + 1 ) ); 1994 1994 for ( $i = 1, $c = count( $folder_parts ); $i <= $c; $i++ ) { … … 2030 2030 } 2031 2031 2032 if ( strlen( $path ) == 0 || $path[0] == '.') {2032 if ( strlen( $path ) == 0 || '.' === $path[0] ) { 2033 2033 return false; 2034 2034 } … … 2040 2040 2041 2041 // A path starting with / or \ is absolute; anything else is relative. 2042 return ( $path[0] == '/' || $path[0] == '\\');2042 return ( '/' === $path[0] || '\\' === $path[0] ); 2043 2043 } 2044 2044 … … 2186 2186 */ 2187 2187 function win_is_writable( $path ) { 2188 if ( $path[ strlen( $path ) - 1 ] == '/') {2188 if ( '/' === $path[ strlen( $path ) - 1 ] ) { 2189 2189 // If it looks like a directory, check a random file within the directory. 2190 2190 return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp' ); … … 2198 2198 2199 2199 $f = @fopen( $path, 'a' ); 2200 if ( $f === false) {2200 if ( false === $f ) { 2201 2201 return false; 2202 2202 } … … 2634 2634 $upload = wp_upload_dir( $time ); 2635 2635 2636 if ( $upload['error'] !== false) {2636 if ( false !== $upload['error'] ) { 2637 2637 return $upload; 2638 2638 } … … 4322 4322 // New subpattern? 4323 4323 if ( $firstchar != $subchar ) { 4324 if ( $subchar != '') {4324 if ( '' != $subchar ) { 4325 4325 $wp_smiliessearch .= ')(?=' . $spaces . '|$)'; // End previous "subpattern". 4326 4326 $wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern". … … 5462 5462 $site_id = (int) $site_id; 5463 5463 5464 return $site_id === get_main_site_id( $network_id );5464 return get_main_site_id( $network_id ) === $site_id; 5465 5465 } 5466 5466 … … 5506 5506 $network_id = (int) $network_id; 5507 5507 5508 return ( $network_id === get_main_network_id());5508 return ( get_main_network_id() === $network_id ); 5509 5509 } 5510 5510 … … 7514 7514 } 7515 7515 7516 if ( $max_execution_time === null) {7516 if ( null === $max_execution_time ) { 7517 7517 // Keep the previous behavior but attempt to prevent fatal errors from timeout if possible. 7518 7518 if ( function_exists( 'ini_get' ) ) { … … 7533 7533 while ( ( $file = readdir( $handle ) ) !== false ) { 7534 7534 $path = $directory . '/' . $file; 7535 if ( $file != '.' && $file != '..') {7535 if ( '.' !== $file && '..' !== $file ) { 7536 7536 if ( is_file( $path ) ) { 7537 7537 $size += filesize( $path );
Note: See TracChangeset
for help on using the changeset viewer.