1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 20:51:53 +02:00

Improved handling of incorrect news URLs.

This commit is contained in:
Cameron 2015-09-08 15:14:07 -07:00
parent 8a4547f62a
commit 787fc12ed9

View File

@ -92,7 +92,12 @@ if ($action == 'all' || $action == 'cat')
$sub_action = intval(varset($tmp[1],0));
}
if($action == 'extend' && empty($sub_action)) // item not found, redirect to avoid messing up search-engine data.
{
$defaultUrl = e107::getUrl()->create('news/list/items');
e107::getRedirect()->go($defaultUrl, null, 301);
exit;
}
@ -141,11 +146,18 @@ $nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
$newsRoute = 'list/all';
$newsUrlparms['id'] = $sub_action;
}
else
{
$newsRoute = 'list/items';
}
else $newsRoute = 'list/items';
$newsRoute = 'news/'.$newsRoute;
if(vartrue($_GET['tag']) || substr($action,0,4) == 'tag=')
{
@ -161,6 +173,7 @@ if(vartrue($_GET['tag']) || substr($action,0,4) == 'tag=')
}
/*
print_a(e_QUERY);
echo "route= ".$newsRoute." ";
echo "<br />action= ".$action." ";
echo "<br />_GET= ".print_a($_GET,true);