Fix some more undefined array key errors
This commit is contained in:
@@ -17,11 +17,11 @@ if ($uri == '') {
|
|||||||
exit;
|
exit;
|
||||||
} elseif (preg_match('/^([a-z]{2})\\/(.+)(\\?.*)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})\\/(.+)(\\?.*)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
if (stringEndsWith($matches[2], 'main')) {
|
if (isset($matches[2]) && stringEndsWith($matches[2], 'main')) {
|
||||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$_GET['page'] = $matches[2];
|
$_GET['page'] = $matches[2] ?? '';
|
||||||
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ if ($uri == '') {
|
|||||||
exit;
|
exit;
|
||||||
} elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
if (stringEndsWith($matches[2], 'main')) {
|
if (isset($matches[2]) && stringEndsWith($matches[2], 'main')) {
|
||||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$_GET['page'] = $matches[2];
|
$_GET['page'] = $matches[2] ?? '';
|
||||||
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ if ($uri == '') {
|
|||||||
exit;
|
exit;
|
||||||
} elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
if (stringEndsWith($matches[2], 'main')) {
|
if (isset($matches[2]) && stringEndsWith($matches[2], 'main')) {
|
||||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$_GET['page'] = $matches[2];
|
$_GET['page'] = $matches[2] ?? '';
|
||||||
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ if ($uri == '') {
|
|||||||
exit;
|
exit;
|
||||||
} elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
if (stringEndsWith($matches[2], 'main')) {
|
if (isset($matches[2]) && stringEndsWith($matches[2], 'main')) {
|
||||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$_GET['page'] = $matches[2];
|
$_GET['page'] = $matches[2] ?? '';
|
||||||
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
} elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
|
||||||
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
$lang = htmlspecialchars(substr($matches[1], 0, 2));
|
||||||
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
$_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
|
||||||
|
|||||||
Reference in New Issue
Block a user