Changeset 55703 for trunk/src/wp-includes/post.php
- Timestamp:
- 05/02/2023 03:43:03 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r55702 r55703 724 724 725 725 // If the file is relative, prepend upload dir. 726 if ( $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) ) {726 if ( $file && ! str_starts_with( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) ) { 727 727 $uploads = wp_get_upload_dir(); 728 728 if ( false === $uploads['error'] ) { … … 796 796 797 797 $uploads = wp_get_upload_dir(); 798 if ( 0 === strpos( $new_path, $uploads['basedir'] ) ) {798 if ( str_starts_with( $new_path, $uploads['basedir'] ) ) { 799 799 $new_path = str_replace( $uploads['basedir'], '', $new_path ); 800 800 $new_path = ltrim( $new_path, '/' ); … … 6484 6484 if ( $uploads && false === $uploads['error'] ) { 6485 6485 // Check that the upload base exists in the file location. 6486 if ( 0 === strpos( $file, $uploads['basedir'] ) ) {6486 if ( str_starts_with( $file, $uploads['basedir'] ) ) { 6487 6487 // Replace file location with url location. 6488 6488 $url = str_replace( $uploads['basedir'], $uploads['baseurl'], $file ); … … 6613 6613 } 6614 6614 6615 if ( 0 === strpos( $post->post_mime_type, $type . '/' ) ) {6615 if ( str_starts_with( $post->post_mime_type, $type . '/' ) ) { 6616 6616 return true; 6617 6617 }
Note: See TracChangeset
for help on using the changeset viewer.