Ticket #36827: 36827.patch
File 36827.patch, 1.5 KB (added by , 7 years ago) |
---|
-
src/wp-includes/functions.php
4154 4154 4155 4155 // The request is for the admin 4156 4156 if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false || strpos( $_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false ) { 4157 $path = preg_replace( '#/(wp-admin/ .*|wp-login.php)#i', '', $_SERVER['REQUEST_URI'] );4157 $path = preg_replace( '#/(wp-admin/?.*|wp-login\.php.*)#i', '', $_SERVER['REQUEST_URI'] ); 4158 4158 4159 4159 // The request is for a file in ABSPATH 4160 4160 } elseif ( $script_filename_dir . '/' == $abspath_fix ) { -
tests/phpunit/tests/includes/helpers.php
212 212 public function test_die_handler_should_handle_wp_error() { 213 213 wp_die( new WP_Error( 'test', 'test' ) ); 214 214 } 215 216 217 function data_guessUrlTestCases() { 218 return array( 219 ['wp-admin'], 220 ['wp-admin/'], 221 ['wp-admin/?foo=bar'], 222 ['wp-login.php'], 223 ['wp-login.php?foo=bar'] 224 ); 225 } 226 227 /** 228 * @dataProvider data_guessUrlTestCases 229 * @ticket 36827 230 */ 231 public function test_guessUrlShouldHandleEdgecases( $url ) { 232 $siteurl = site_url(); 233 $this->go_to( site_url( $url ) ); 234 $this->assertEquals($siteurl, wp_guess_url()); 235 } 236 215 237 }