Changeset 47808 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 05/16/2020 06:40:52 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r47783 r47808 380 380 $sentence = preg_replace( $quote_pattern, $close_quote, $sentence ); 381 381 } 382 if ( '"' == $needle && false !== strpos( $sentence, '"' ) ) {382 if ( '"' === $needle && false !== strpos( $sentence, '"' ) ) { 383 383 $sentence = str_replace( '"', $close_quote, $sentence ); 384 384 } … … 1939 1939 $locale = get_locale(); 1940 1940 1941 if ( 'de_DE' == $locale || 'de_DE_formal' == $locale || 'de_CH' == $locale || 'de_CH_informal' == $locale) {1941 if ( in_array( $locale, array( 'de_DE', 'de_DE_formal', 'de_CH', 'de_CH_informal' ), true ) ) { 1942 1942 $chars['Ä'] = 'Ae'; 1943 1943 $chars['ä'] = 'ae'; … … 2180 2180 $raw_title = $title; 2181 2181 2182 if ( 'save' == $context ) {2182 if ( 'save' === $context ) { 2183 2183 $title = remove_accents( $title ); 2184 2184 } … … 2247 2247 $title = strtolower( $title ); 2248 2248 2249 if ( 'save' == $context ) {2249 if ( 'save' === $context ) { 2250 2250 // Convert  , &ndash, and &mdash to hyphens. 2251 2251 $title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title ); … … 2355 2355 $sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized ); 2356 2356 2357 if ( '' == $sanitized && $fallback ) {2357 if ( '' === $sanitized && $fallback ) { 2358 2358 return sanitize_html_class( $fallback ); 2359 2359 } … … 2837 2837 $url = $matches[2]; 2838 2838 2839 if ( ')' == $matches[3] && strpos( $url, '(' ) ) {2839 if ( ')' === $matches[3] && strpos( $url, '(' ) ) { 2840 2840 // If the trailing character is a closing parethesis, and the URL has an opening parenthesis in it, 2841 2841 // add the closing parenthesis to the URL. Then we can let the parenthesis balancer do its thing below. … … 3371 3371 3372 3372 // If we're in an ignore block, wait until we find its closing tag. 3373 if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')[^>]*>/', $content, $matches ) ) {3373 if ( '' === $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')[^>]*>/', $content, $matches ) ) { 3374 3374 $ignore_block_element = $matches[1]; 3375 3375 } 3376 3376 3377 3377 // If it's not a tag and not in ignore block. 3378 if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {3378 if ( '' === $ignore_block_element && strlen( $content ) > 0 && '<' !== $content[0] ) { 3379 3379 $content = preg_replace_callback( $wp_smiliessearch, 'translate_smiley', $content ); 3380 3380 } 3381 3381 3382 3382 // Did we exit ignore block? 3383 if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>'== $content ) {3383 if ( '' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content ) { 3384 3384 $ignore_block_element = ''; 3385 3385 } … … 3574 3574 $offset = 0; 3575 3575 } else { 3576 $sign = ( substr( $timezone, 0, 1 ) == '+') ? 1 : -1;3576 $sign = ( '+' === substr( $timezone, 0, 1 ) ) ? 1 : -1; 3577 3577 $hours = intval( substr( $timezone, 1, 2 ) ); 3578 3578 $minutes = intval( substr( $timezone, 3, 4 ) ) / 60; … … 3814 3814 function wp_trim_excerpt( $text = '', $post = null ) { 3815 3815 $raw_excerpt = $text; 3816 if ( '' == $text ) { 3816 3817 if ( '' === $text ) { 3817 3818 $post = get_post( $post ); 3818 3819 $text = get_the_content( '', false, $post ); … … 4308 4309 $original_url = $url; 4309 4310 4310 if ( '' == $url ) {4311 if ( '' === $url ) { 4311 4312 return $url; 4312 4313 } … … 4336 4337 4337 4338 // Replace ampersands and single quotes only when displaying. 4338 if ( 'display' == $_context ) {4339 if ( 'display' === $_context ) { 4339 4340 $url = wp_kses_normalize_entities( $url ); 4340 4341 $url = str_replace( '&', '&', $url ); … … 4646 4647 case 'default_comment_status': 4647 4648 // Options that if not there have 0 value but need to be something like "closed". 4648 if ( '0' == $value || '' == $value ) {4649 if ( '0' == $value || '' === $value ) { 4649 4650 $value = 'closed'; 4650 4651 } … … 4978 4979 4979 4980 // Literal %: append and continue. 4980 if ( substr( $pattern, $start, 2 ) == '%%') {4981 if ( '%%' === substr( $pattern, $start, 2 ) ) { 4981 4982 $start += 2; 4982 4983 $result .= '%'; … … 5044 5045 function wp_sprintf_l( $pattern, $args ) { 5045 5046 // Not a match. 5046 if ( substr( $pattern, 0, 2 ) != '%l') {5047 if ( '%l' !== substr( $pattern, 0, 2 ) ) { 5047 5048 return $pattern; 5048 5049 } … … 5807 5808 5808 5809 // If we're in an ignore block, wait until we find its closing tag. 5809 if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {5810 if ( '' === $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { 5810 5811 $ignore_block_element = $matches[1]; 5811 5812 } 5812 5813 5813 5814 // If it's not a tag and not in ignore block. 5814 if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] && false !== strpos( $content, '&#x' ) ) {5815 if ( '' === $ignore_block_element && strlen( $content ) > 0 && '<' !== $content[0] && false !== strpos( $content, '&#x' ) ) { 5815 5816 foreach ( $possible_emoji as $emojum => $emoji_char ) { 5816 5817 if ( false === strpos( $content, $emojum ) ) { … … 5828 5829 5829 5830 // Did we exit ignore block? 5830 if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>'== $content ) {5831 if ( '' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content ) { 5831 5832 $ignore_block_element = ''; 5832 5833 }
Note: See TracChangeset
for help on using the changeset viewer.