Changeset 47808 for trunk/src/wp-includes/functions.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r47617 r47808 641 641 } 642 642 $data = trim( $data ); 643 if ( 'N;' == $data ) {643 if ( 'N;' === $data ) { 644 644 return true; 645 645 } … … 1518 1518 */ 1519 1519 function bool_from_yn( $yn ) { 1520 return ( strtolower( $yn ) == 'y');1520 return ( 'y' === strtolower( $yn ) ); 1521 1521 } 1522 1522 … … 1541 1541 $feed = preg_replace( '/^_+/', '', $feed ); 1542 1542 1543 if ( '' == $feed || 'feed' === $feed ) {1543 if ( '' === $feed || 'feed' === $feed ) { 1544 1544 $feed = get_default_feed(); 1545 1545 } … … 1842 1842 echo $referer_field; 1843 1843 } 1844 1844 1845 return $referer_field; 1845 1846 } … … 1861 1862 function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) { 1862 1863 $ref = wp_get_original_referer(); 1864 1863 1865 if ( ! $ref ) { 1864 $ref = 'previous' == $jump_back_to ? wp_get_referer() : wp_unslash( $_SERVER['REQUEST_URI'] ); 1865 } 1866 $ref = ( 'previous' === $jump_back_to ) ? wp_get_referer() : wp_unslash( $_SERVER['REQUEST_URI'] ); 1867 } 1868 1866 1869 $orig_referer_field = '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( $ref ) . '" />'; 1870 1867 1871 if ( $echo ) { 1868 1872 echo $orig_referer_field; 1869 1873 } 1874 1870 1875 return $orig_referer_field; 1871 1876 } … … 1973 1978 // We need to find the permissions of the parent folder that exists and inherit that. 1974 1979 $target_parent = dirname( $target ); 1975 while ( '.' != $target_parent && ! is_dir( $target_parent ) && dirname( $target_parent ) !== $target_parent ) {1980 while ( '.' !== $target_parent && ! is_dir( $target_parent ) && dirname( $target_parent ) !== $target_parent ) { 1976 1981 $target_parent = dirname( $target_parent ); 1977 1982 } … … 2335 2340 $upload_path = trim( get_option( 'upload_path' ) ); 2336 2341 2337 if ( empty( $upload_path ) || 'wp-content/uploads' == $upload_path ) {2342 if ( empty( $upload_path ) || 'wp-content/uploads' === $upload_path ) { 2338 2343 $dir = WP_CONTENT_DIR . '/uploads'; 2339 2344 } elseif ( 0 !== strpos( $upload_path, ABSPATH ) ) { … … 2346 2351 $url = get_option( 'upload_url_path' ); 2347 2352 if ( ! $url ) { 2348 if ( empty( $upload_path ) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) ) {2353 if ( empty( $upload_path ) || ( 'wp-content/uploads' === $upload_path ) || ( $upload_path == $dir ) ) { 2349 2354 $url = WP_CONTENT_URL . '/uploads'; 2350 2355 } else { … … 3212 3217 */ 3213 3218 function wp_nonce_ays( $action ) { 3214 if ( 'log-out' == $action ) {3219 if ( 'log-out' === $action ) { 3215 3220 $html = sprintf( 3216 3221 /* translators: %s: Site title. */ … … 3540 3545 3541 3546 <?php 3542 if ( 'rtl' == $text_direction ) {3547 if ( 'rtl' === $text_direction ) { 3543 3548 echo 'body { font-family: Tahoma, Arial; }'; 3544 3549 } … … 4334 4339 // New subpattern? 4335 4340 if ( $firstchar != $subchar ) { 4336 if ( '' != $subchar ) {4341 if ( '' !== $subchar ) { 4337 4342 $wp_smiliessearch .= ')(?=' . $spaces . '|$)'; // End previous "subpattern". 4338 4343 $wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern". … … 5215 5220 $server_parts = explode( '/', isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '' ); 5216 5221 $server_parts[1] = isset( $server_parts[1] ) ? $server_parts[1] : ''; 5217 return 'lighttpd' == $server_parts[0] && -1 == version_compare( $server_parts[1], '1.5.0' ); 5222 5223 return ( 'lighttpd' === $server_parts[0] && -1 == version_compare( $server_parts[1], '1.5.0' ) ); 5218 5224 } 5219 5225 … … 5249 5255 } 5250 5256 } 5257 5251 5258 return $default; 5252 5259 } … … 5275 5282 * via ISAPI then pretty permalinks will not work. 5276 5283 */ 5277 $supports_permalinks = class_exists( 'DOMDocument', false ) && isset( $_SERVER['IIS_UrlRewriteModule'] ) && ( PHP_SAPI == 'cgi-fcgi');5284 $supports_permalinks = class_exists( 'DOMDocument', false ) && isset( $_SERVER['IIS_UrlRewriteModule'] ) && ( 'cgi-fcgi' === PHP_SAPI ); 5278 5285 } 5279 5286 … … 5325 5332 5326 5333 // Absolute Windows drive paths are not allowed: 5327 if ( ':' == substr( $file, 1, 1 ) ) {5334 if ( ':' === substr( $file, 1, 1 ) ) { 5328 5335 return 2; 5329 5336 } … … 5365 5372 */ 5366 5373 function wp_guess_url() { 5367 if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL ) {5374 if ( defined( 'WP_SITEURL' ) && '' !== WP_SITEURL ) { 5368 5375 $url = WP_SITEURL; 5369 5376 } else { … … 5376 5383 5377 5384 // The request is for a file in ABSPATH. 5378 } elseif ( $script_filename_dir . '/' == $abspath_fix ) {5385 } elseif ( $script_filename_dir . '/' === $abspath_fix ) { 5379 5386 // Strip off any file/query params in the path. 5380 5387 $path = preg_replace( '#/[^/]*$#i', '', $_SERVER['PHP_SELF'] ); … … 5936 5943 $del_post = get_post( $post_id ); 5937 5944 5938 if ( ! $del_post || 'trash' != $del_post->post_status ) {5945 if ( ! $del_post || 'trash' !== $del_post->post_status ) { 5939 5946 delete_post_meta( $post_id, '_wp_trash_meta_status' ); 5940 5947 delete_post_meta( $post_id, '_wp_trash_meta_time' ); … … 5954 5961 $del_comment = get_comment( $comment_id ); 5955 5962 5956 if ( ! $del_comment || 'trash' != $del_comment->comment_approved ) {5963 if ( ! $del_comment || 'trash' !== $del_comment->comment_approved ) { 5957 5964 delete_comment_meta( $comment_id, '_wp_trash_meta_time' ); 5958 5965 delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
Note: See TracChangeset
for help on using the changeset viewer.