Changeset 54713
- Timestamp:
- 10/28/2022 03:28:59 PM (2 years ago)
- Location:
- branches/6.1
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.1/src/wp-includes/functions.php
r54522 r54713 2080 2080 * 2081 2081 * @since 2.5.0 2082 * @since 6.1.0 Allows normalized Windows paths (forward slashes).2083 2082 * 2084 2083 * @param string $path File path. … … 2108 2107 // Windows allows absolute paths like this. 2109 2108 if ( preg_match( '#^[a-zA-Z]:\\\\#', $path ) ) { 2110 return true;2111 }2112 2113 // Normalized Windows paths for local filesystem and network shares (forward slashes).2114 if ( preg_match( '#(^[a-zA-Z]+:/|^//[\w!@\#\$%\^\(\)\-\'{}\.~]{1,15})#', $path ) ) {2115 2109 return true; 2116 2110 } -
branches/6.1/src/wp-includes/post.php
r54524 r54713 725 725 726 726 // If the file is relative, prepend upload dir. 727 if ( $file ) {727 if ( $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) ) { 728 728 $uploads = wp_get_upload_dir(); 729 730 729 if ( false === $uploads['error'] ) { 731 $file = path_join( $uploads['basedir'], $file );730 $file = $uploads['basedir'] . "/$file"; 732 731 } 733 732 } -
branches/6.1/tests/phpunit/tests/functions.php
r54509 r54713 106 106 'C:\\WINDOWS', 107 107 '\\\\sambashare\\foo', 108 'c:/',109 'c://',110 '//',111 'c:/FOO',112 '//FOO',113 'C:/WWW/Sites/demo/htdocs/wordpress/wp-content/uploads/2016/03/example.jpg',114 '//ComputerName/ShareName/SubfolderName/example.txt',115 108 ); 116 109 foreach ( $absolute_paths as $path ) { … … 127 120 '../', 128 121 '../foo.bar', 129 'foo.bar',130 122 'foo/bar', 131 123 'foo', 132 124 'FOO', 133 125 '..\\WINDOWS', 134 '..//WINDOWS',135 'c:',136 'C:',137 126 ); 138 127 foreach ( $relative_paths as $path ) {
Note: See TracChangeset
for help on using the changeset viewer.