Page/Selector
* don't just cast the page call to lowercase but redirect to the fixed case if necessary
This commit is contained in:
parent
10ef33f709
commit
73d6be273e
1 changed files with 8 additions and 2 deletions
10
index.php
10
index.php
|
|
@ -13,9 +13,15 @@ $pageParam = '';
|
|||
parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $query);
|
||||
foreach ($query as $page => $param)
|
||||
{
|
||||
$page = preg_replace('/[^\w\-]/i', '', $page);
|
||||
// fix page calls - pages like saerch use the page call directly and expect it as lower case
|
||||
if (preg_match('/[A-Z]/', $page))
|
||||
{
|
||||
$url = str_replace('?'.$page.'=', '?'.Util::lower($page).'=', $_SERVER['REQUEST_URI']);
|
||||
header('Location: '.$url, true, 302);
|
||||
exit;
|
||||
}
|
||||
|
||||
$pageCall = Util::lower($page);
|
||||
$pageCall = preg_replace('/[^\w\-]/i', '', $page);
|
||||
$pageParam = $param ?? '';
|
||||
break; // only use first k/v-pair to determine page
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue