mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 17:59:22 +02:00
Workaround for links from fb, like ?fbclid=x
Now shows news page, instead of "not found". For 0.9 there is better solution
This commit is contained in:
parent
e081a67589
commit
073d9da0bc
15
index.php
15
index.php
@ -74,15 +74,24 @@ if((!isset($config['installed']) || !$config['installed']) && file_exists(BASE .
|
|||||||
throw new RuntimeException('Setup detected that <b>install/</b> directory exists. Please visit <a href="' . BASE_URL . 'install">this</a> url to start MyAAC Installation.<br/>Delete <b>install/</b> directory if you already installed MyAAC.<br/>Remember to REFRESH this page when you\'re done!');
|
throw new RuntimeException('Setup detected that <b>install/</b> directory exists. Please visit <a href="' . BASE_URL . 'install">this</a> url to start MyAAC Installation.<br/>Delete <b>install/</b> directory if you already installed MyAAC.<br/>Remember to REFRESH this page when you\'re done!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$isEmptyGet = false;
|
||||||
|
if (!empty($_GET)) {
|
||||||
|
foreach ($_GET as $value) {
|
||||||
|
if (empty($value)) {
|
||||||
|
$isEmptyGet = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$found = false;
|
$found = false;
|
||||||
if(empty($uri) || isset($_REQUEST['template'])) {
|
if(empty($uri) || isset($_REQUEST['template']) || (!$isEmptyGet && !isset($_REQUEST['subtopic']) && !isset($_REQUEST['p']))) {
|
||||||
$_REQUEST['p'] = 'news';
|
$_REQUEST['p'] = $_REQUEST['subtopic'] = 'news';
|
||||||
$found = true;
|
$found = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$tmp = strtolower($uri);
|
$tmp = strtolower($uri);
|
||||||
if(!preg_match('/[^A-z0-9_\-]/', $uri) && file_exists(SYSTEM . 'pages/' . $tmp . '.php')) {
|
if(!preg_match('/[^A-z0-9_\-]/', $uri) && file_exists(SYSTEM . 'pages/' . $tmp . '.php')) {
|
||||||
$_REQUEST['p'] = $uri;
|
$_REQUEST['p'] = $_REQUEST['subtopic'] = $uri;
|
||||||
$found = true;
|
$found = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -33,7 +33,7 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$tmp = URI;
|
$tmp = URI;
|
||||||
if(empty($tmp)) {
|
if(empty($tmp) || !$isEmptyGet) {
|
||||||
$tmp = array('news');
|
$tmp = array('news');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user