Changeset 56325 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 07/30/2023 08:51:37 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r56244 r56325 355 355 $sentence = preg_replace( $flag_after_digit, $prime, $sentence ); 356 356 $sentence = str_replace( $flag, $close_quote, $sentence ); 357 } elseif ( 1 == $count ) {357 } elseif ( 1 === $count ) { 358 358 // Found only one closing quote candidate, so give it priority over primes. 359 359 $sentence = str_replace( $flag, $close_quote, $sentence ); … … 423 423 424 424 array_push( $stack, $tag ); 425 } elseif ( end( $stack ) == $tag ) {425 } elseif ( end( $stack ) === $tag ) { 426 426 array_pop( $stack ); 427 427 } … … 885 885 $length = strlen( $str ); 886 886 reset_mbstring_encoding(); 887 887 888 for ( $i = 0; $i < $length; $i++ ) { 888 889 $c = ord( $str[ $i ] ); 890 889 891 if ( $c < 0x80 ) { 890 892 $n = 0; // 0bbbbbbb 891 } elseif ( ( $c & 0xE0 ) == 0xC0 ) {893 } elseif ( ( $c & 0xE0 ) === 0xC0 ) { 892 894 $n = 1; // 110bbbbb 893 } elseif ( ( $c & 0xF0 ) == 0xE0 ) {895 } elseif ( ( $c & 0xF0 ) === 0xE0 ) { 894 896 $n = 2; // 1110bbbb 895 } elseif ( ( $c & 0xF8 ) == 0xF0 ) {897 } elseif ( ( $c & 0xF8 ) === 0xF0 ) { 896 898 $n = 3; // 11110bbb 897 } elseif ( ( $c & 0xFC ) == 0xF8 ) {899 } elseif ( ( $c & 0xFC ) === 0xF8 ) { 898 900 $n = 4; // 111110bb 899 } elseif ( ( $c & 0xFE ) == 0xFC ) {901 } elseif ( ( $c & 0xFE ) === 0xFC ) { 900 902 $n = 5; // 1111110b 901 903 } else { 902 904 return false; // Does not match any model. 903 905 } 906 904 907 for ( $j = 0; $j < $n; $j++ ) { // n bytes matching 10bbbbbb follow ? 905 if ( ( ++$i === $length ) || ( ( ord( $str[ $i ] ) & 0xC0 ) != 0x80 ) ) {908 if ( ( ++$i === $length ) || ( ( ord( $str[ $i ] ) & 0xC0 ) !== 0x80 ) ) { 906 909 return false; 907 910 } 908 911 } 909 912 } 913 910 914 return true; 911 915 } … … 2911 2915 function antispambot( $email_address, $hex_encoding = 0 ) { 2912 2916 $email_no_spam_address = ''; 2917 2913 2918 for ( $i = 0, $len = strlen( $email_address ); $i < $len; $i++ ) { 2914 2919 $j = rand( 0, 1 + $hex_encoding ); 2915 if ( 0 == $j ) { 2920 2921 if ( 0 === $j ) { 2916 2922 $email_no_spam_address .= '&#' . ord( $email_address[ $i ] ) . ';'; 2917 } elseif ( 1 == $j ) {2923 } elseif ( 1 === $j ) { 2918 2924 $email_no_spam_address .= $email_address[ $i ]; 2919 } elseif ( 2 == $j ) {2925 } elseif ( 2 === $j ) { 2920 2926 $email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[ $i ] ) ), 2 ); 2921 2927 } … … 4893 4899 case 'default_comment_status': 4894 4900 // Options that if not there have 0 value but need to be something like "closed". 4895 if ( '0' == $value || '' === $value ) {4901 if ( '0' === (string) $value || '' === $value ) { 4896 4902 $value = 'closed'; 4897 4903 } … … 5231 5237 $result = ''; 5232 5238 $arg_index = 0; 5239 5233 5240 while ( $len > $start ) { 5234 5241 // Last character: append and break. … … 5275 5282 */ 5276 5283 $_fragment = apply_filters( 'wp_sprintf', $fragment, $arg ); 5277 if ( $_fragment != $fragment ) { 5284 5285 if ( $_fragment !== $fragment ) { 5278 5286 $fragment = $_fragment; 5279 5287 } else { … … 5382 5390 // Remove part of an entity at the end. 5383 5391 $excerpt = preg_replace( '/&[^;\s]{0,6}$/', '', $excerpt ); 5384 if ( $str != $excerpt ) { 5392 5393 if ( $str !== $excerpt ) { 5385 5394 $excerpt = trim( $excerpt ) . $more; 5386 5395 }
Note: See TracChangeset
for help on using the changeset viewer.