Changeset 56031
- Timestamp:
- 06/26/2023 10:15:04 AM (18 months ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r55990 r56031 3320 3320 3321 3321 $url = empty( $attachment['url'] ) ? '' : $attachment['url']; 3322 $rel = ( str pos( $url, 'attachment_id' ) || get_attachment_link( $id )== $url );3322 $rel = ( str_contains( $url, 'attachment_id' ) || get_attachment_link( $id ) === $url ); 3323 3323 3324 3324 remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' ); -
trunk/src/wp-admin/includes/media.php
r55990 r56031 832 832 $rel = ''; 833 833 834 if ( str pos( $attachment['url'], 'attachment_id' ) || get_attachment_link( $send_id )== $attachment['url'] ) {834 if ( str_contains( $attachment['url'], 'attachment_id' ) || get_attachment_link( $send_id ) === $attachment['url'] ) { 835 835 $rel = " rel='attachment wp-att-" . esc_attr( $send_id ) . "'"; 836 836 } … … 1360 1360 $size = ! empty( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium'; 1361 1361 $alt = ! empty( $attachment['image_alt'] ) ? $attachment['image_alt'] : ''; 1362 $rel = ( str pos( $url, 'attachment_id' ) || get_attachment_link( $attachment_id ) === $url );1362 $rel = ( str_contains( $url, 'attachment_id' ) || get_attachment_link( $attachment_id ) === $url ); 1363 1363 1364 1364 return get_image_send_to_editor( $attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt ); -
trunk/src/wp-includes/class-wp-editor.php
r55988 r56031 572 572 // Force urlencoding of commas. 573 573 foreach ( $editor_styles as $key => $url ) { 574 if ( str pos( $url, ',' ) !== false) {574 if ( str_contains( $url, ',' ) ) { 575 575 $editor_styles[ $key ] = str_replace( ',', '%2C', $url ); 576 576 } -
trunk/src/wp-includes/class-wp-rewrite.php
r56014 r56031 1061 1061 * minute all present). Set these flags now as we need them for the endpoints. 1062 1062 */ 1063 if ( strpos( $struct, '%postname%' ) !== false 1064 || strpos( $struct, '%post_id%' ) !== false 1065 || strpos( $struct, '%pagename%' ) !== false 1066 || ( strpos( $struct, '%year%' ) !== false && strpos( $struct, '%monthnum%' ) !== false && strpos( $struct, '%day%' ) !== false && strpos( $struct, '%hour%' ) !== false && strpos( $struct, '%minute%' ) !== false && strpos( $struct, '%second%' ) !== false ) 1067 ) { 1063 if ( str_contains( $struct, '%postname%' ) 1064 || str_contains( $struct, '%post_id%' ) 1065 || str_contains( $struct, '%pagename%' ) 1066 || ( str_contains( $struct, '%year%' ) 1067 && str_contains( $struct, '%monthnum%' ) 1068 && str_contains( $struct, '%day%' ) 1069 && str_contains( $struct, '%hour%' ) 1070 && str_contains( $struct, '%minute%' ) 1071 && str_contains( $struct, '%second%' ) ) 1072 ) { 1068 1073 $post = true; 1069 if ( str pos( $struct, '%pagename%' ) !== false) {1074 if ( str_contains( $struct, '%pagename%' ) ) { 1070 1075 $page = true; 1071 1076 } … … 1075 1080 // For custom post types, we need to add on endpoints as well. 1076 1081 foreach ( get_post_types( array( '_builtin' => false ) ) as $ptype ) { 1077 if ( str pos( $struct, "%$ptype%" ) !== false) {1082 if ( str_contains( $struct, "%$ptype%" ) ) { 1078 1083 $post = true; 1079 1084 … … 1556 1561 $match = str_replace( '.+?', '.+', $match ); 1557 1562 1558 if ( str pos( $query, $this->index ) !== false) {1563 if ( str_contains( $query, $this->index ) ) { 1559 1564 $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; 1560 1565 } else { -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r55988 r56031 6991 6991 6992 6992 foreach ( $p as $para ) { 6993 if ( str pos( $para, $pagelinkedto ) !== false) { // It exists, but is it a link?6993 if ( str_contains( $para, $pagelinkedto ) ) { // It exists, but is it a link? 6994 6994 preg_match( '|<a[^>]+?' . $preg_target . '[^>]*>([^>]+?)</a>|', $para, $context ); 6995 6995 -
trunk/src/wp-includes/formatting.php
r56021 r56031 1020 1020 1021 1021 // Don't bother if there are no entities - saves a lot of processing. 1022 if ( strpos( $text, '&' ) === false) {1022 if ( ! str_contains( $text, '&' ) ) { 1023 1023 return $text; 1024 1024 } … … 2475 2475 } 2476 2476 2477 if ( str pos( $content, '&' ) !== false) {2477 if ( str_contains( $content, '&' ) ) { 2478 2478 $content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content ); 2479 2479 } … … 2526 2526 ); 2527 2527 2528 if ( str pos( $content, '' ) !== false) {2528 if ( str_contains( $content, '' ) ) { 2529 2529 $content = strtr( $content, $wp_htmltranswinuni ); 2530 2530 } … … 5582 5582 $filtered = wp_check_invalid_utf8( $str ); 5583 5583 5584 if ( str pos( $filtered, '<' ) !== false) {5584 if ( str_contains( $filtered, '<' ) ) { 5585 5585 $filtered = wp_pre_kses_less_than( $filtered ); 5586 5586 // This will strip extra whitespace for us. … … 6067 6067 6068 6068 foreach ( $headers as $header ) { 6069 if ( strpos( $header, ':' ) === false) {6069 if ( ! str_contains( $header, ':' ) ) { 6070 6070 continue; 6071 6071 } … … 6079 6079 6080 6080 if ( 'content-type' === strtolower( $name ) ) { 6081 if ( str pos( $content, ';' ) !== false) {6081 if ( str_contains( $content, ';' ) ) { 6082 6082 list( $type, $charset ) = explode( ';', $content ); 6083 6083 $content_type = trim( $type ); -
trunk/src/wp-includes/functions.php
r55990 r56031 6105 6105 6106 6106 // The request is for the admin. 6107 if ( str pos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false|| str_contains( $_SERVER['REQUEST_URI'], 'wp-login.php' ) ) {6107 if ( str_contains( $_SERVER['REQUEST_URI'], 'wp-admin' ) || str_contains( $_SERVER['REQUEST_URI'], 'wp-login.php' ) ) { 6108 6108 $path = preg_replace( '#/(wp-admin/?.*|wp-login\.php.*)#i', '', $_SERVER['REQUEST_URI'] ); 6109 6109 -
trunk/src/wp-includes/general-template.php
r55988 r56031 908 908 909 909 $url = true; 910 if ( strpos( $show, 'url' ) === false && 911 strpos( $show, 'directory' ) === false && 912 strpos( $show, 'home' ) === false ) { 910 911 if ( ! str_contains( $show, 'url' ) 912 && ! str_contains( $show, 'directory' ) 913 && ! str_contains( $show, 'home' ) 914 ) { 913 915 $url = false; 914 916 } … … 3739 3741 $wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && (int) $match[1] >= 534 ); 3740 3742 } elseif ( $is_IE ) { 3741 $wp_rich_edit = ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident/7.0;' ) !== false);3743 $wp_rich_edit = str_contains( $_SERVER['HTTP_USER_AGENT'], 'Trident/7.0;' ); 3742 3744 } elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && ! wp_is_mobile() ) ) { 3743 3745 $wp_rich_edit = true; -
trunk/src/wp-includes/load.php
r56014 r56031 74 74 75 75 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests. 76 if ( isset( $_SERVER['SCRIPT_FILENAME'] ) 77 && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) === strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) 78 ) { 76 if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && str_ends_with( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) ) { 79 77 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; 80 78 } 81 79 82 80 // Fix for Dreamhost and other PHP as CGI hosts. 83 if ( isset( $_SERVER['SCRIPT_NAME'] ) && ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false) ) {81 if ( isset( $_SERVER['SCRIPT_NAME'] ) && str_contains( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) ) { 84 82 unset( $_SERVER['PATH_INFO'] ); 85 83 } -
trunk/src/wp-includes/media.php
r55990 r56031 4060 4060 * See #29602. 4061 4061 */ 4062 if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false && 4063 strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) { 4064 4062 if ( wp_is_mobile() 4063 && str_contains( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) 4064 && str_contains( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) 4065 ) { 4065 4066 $defaults['multi_selection'] = false; 4066 4067 } -
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r55703 r56031 1539 1539 1540 1540 // For non-variable routes, generate links. 1541 if ( strpos( $route, '{' ) === false) {1541 if ( ! str_contains( $route, '{' ) ) { 1542 1542 $data['_links'] = array( 1543 1543 'self' => array( -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r56019 r56031 1112 1112 $value = trim( $value ); 1113 1113 1114 if ( strpos( $value, ';' ) === false) {1114 if ( ! str_contains( $value, ';' ) ) { 1115 1115 continue; 1116 1116 } … … 1122 1122 1123 1123 foreach ( $attr_parts as $part ) { 1124 if ( strpos( $part, '=' ) === false) {1124 if ( ! str_contains( $part, '=' ) ) { 1125 1125 continue; 1126 1126 }
Note: See TracChangeset
for help on using the changeset viewer.