I am parsing REQUEST_URI into an array.
Now I have the following code:
private function load_url_vars() { if (preg_match('/^.+\?(.+)$/', $_SERVER["REQUEST_URI"], $matches)) { $varpairs = preg_split("/&/", $matches[1]); foreach ($varpairs as $varpair) { if (preg_match('/^([A-Za-z_]+)=(.*)$/', $varpair, $varmatch)) { $this->urlvars[$varmatch[1]] = urldecode($varmatch[2]); } } } }
Are there any security issues doing this this way? Is this a good way to take it apart?
Change the language
php regex
OMGKurtNilsen
source share