/// @todo FIXME: this sort of dupes some code in WebRequest::getRequestUrl()
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
// Strip the query string...
- list( $path ) = explode( '?', $_SERVER['REQUEST_URI'], 2 );
+ $path = explode( '?', $_SERVER['REQUEST_URI'], 2 )[0];
} elseif ( isset( $_SERVER['SCRIPT_NAME'] ) ) {
// Probably IIS. QUERY_STRING appears separately.
$path = $_SERVER['SCRIPT_NAME'];