Changeset 10497 for sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php
- Timestamp:
- 12/08/2020 12:22:26 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php
r10488 r10497 119 119 } 120 120 121 $new_path = $path = $_SERVER['REQUEST_URI']; 121 $path = $_SERVER['REQUEST_URI'] ?? '/'; 122 // Remove the site prefix. 123 $path = preg_replace( '!^' . preg_quote( wp_parse_url( home_url( '/' ), PHP_URL_PATH ), '!' ) . '!', '/', $path ); 124 125 $new_path = $path; 122 126 123 127 // Remove any common URL paths. … … 128 132 129 133 // Remove any trailing punctuation. 130 $new_path = preg_replace( '!([ +\'" \W]|(?:%20))+$!', '', $new_path );134 $new_path = preg_replace( '!([ +\'"]|(?:%20))+$!', '', $new_path ); 131 135 132 136 if ( $path === $new_path ) {
Note: See TracChangeset
for help on using the changeset viewer.