// URI is found, and also fixes the QUERY_STRING Server var and $_GET array.
if (trim($uri, '/'
) === '' &&
strncmp($query, '/', 1
) === 0
) { $query =
explode('?',
$query, 2
);
$uri =
$query[0
];
$_SERVER['QUERY_STRING'
] =
$query[1
] ?? '';
} else { $_SERVER['QUERY_STRING'
] =
$query;
} // Update our globals for values likely to been have changed
parse_str($_SERVER['QUERY_STRING'
],
$_GET);
$this->
populateGlobals('server'
);
$this->
populateGlobals('get'
);
$uri = URI::
removeDotSegments($uri);
return ($uri === '/' ||
$uri === ''
) ? '/' :
ltrim($uri, '/'
);
} /**
* Parse QUERY_STRING
*
* Will parse QUERY_STRING and automatically detect the URI from it.
*
* @deprecated 4.4.0 Moved to SiteURIFactory.
*/