Changeset 47550 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 04/05/2020 03:00:44 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r47461 r47550 425 425 426 426 // Handle disabled tags. 427 if ( in_array( $tag, $disabled_elements ) ) {427 if ( in_array( $tag, $disabled_elements, true ) ) { 428 428 if ( $opening_tag ) { 429 429 /* … … 979 979 } 980 980 981 if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) ) {981 if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ), true ) ) { 982 982 $charset = 'UTF-8'; 983 983 } … … 1124 1124 static $is_utf8 = null; 1125 1125 if ( ! isset( $is_utf8 ) ) { 1126 $is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );1126 $is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ); 1127 1127 } 1128 1128 if ( ! $is_utf8 ) { … … 2877 2877 2878 2878 // Removed trailing [.,;:)] from URL. 2879 if ( in_array( substr( $dest, -1 ), array( '.', ',', ';', ':', ')' ) ) === true ) { 2880 $ret = substr( $dest, -1 ); 2879 $last_char = substr( $dest, -1 ); 2880 if ( in_array( $last_char, array( '.', ',', ';', ':', ')' ), true ) === true ) { 2881 $ret = $last_char; 2881 2882 $dest = substr( $dest, 0, strlen( $dest ) - 1 ); 2882 2883 } … … 3306 3307 3307 3308 // Don't convert smilies that aren't images - they're probably emoji. 3308 if ( ! in_array( $ext, $image_exts ) ) {3309 if ( ! in_array( $ext, $image_exts, true ) ) { 3309 3310 return $img; 3310 3311 } … … 4312 4313 * starting with /, # or ?, or a PHP file). 4313 4314 */ 4314 if ( strpos( $url, ':' ) === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&4315 if ( strpos( $url, ':' ) === false && ! in_array( $url[0], array( '/', '#', '?' ), true ) && 4315 4316 ! preg_match( '/^[a-z0-9-]+?\.php/i', $url ) ) { 4316 4317 $url = 'http://' . $url; … … 4716 4717 $allowed[] = WPLANG; 4717 4718 } 4718 if ( ! in_array( $value, $allowed ) && ! empty( $value ) ) {4719 if ( ! in_array( $value, $allowed, true ) && ! empty( $value ) ) { 4719 4720 $value = get_option( $option ); 4720 4721 } … … 4764 4765 case 'timezone_string': 4765 4766 $allowed_zones = timezone_identifiers_list(); 4766 if ( ! in_array( $value, $allowed_zones ) && ! empty( $value ) ) {4767 if ( ! in_array( $value, $allowed_zones, true ) && ! empty( $value ) ) { 4767 4768 $error = __( 'The timezone you have entered is not valid. Please select a valid timezone.' ); 4768 4769 } … … 5146 5147 // 1 = attribute name 2 = quotation mark 3 = URL. 5147 5148 return $m[1] . '=' . $m[2] . 5148 ( preg_match( '#^(\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols() ) ?5149 ( preg_match( '#^(\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols(), true ) ? 5149 5150 $m[3] : 5150 5151 WP_Http::make_absolute_url( $m[3], $_links_add_base )
Note: See TracChangeset
for help on using the changeset viewer.