Commit f55d6206 authored by sylvieg's avatar sylvieg

[FIX]sefurl: better fix to 33975 when switching with url cat111-xxx

parent 1306ebf7
......@@ -14,14 +14,15 @@ elseif (isset($_SERVER['HTTP_REFERER'])) $orig_url = $_SERVER['HTTP_REFERER'];
else $orig_url = $prefs['tikiIndex'];
if ($prefs['feature_sefurl'] == 'y' && !strstr($orig_url, '.php')) {
if (preg_match('/cat[0-9]+-?/', $orig)) {
if (preg_match('/cat[0-9]+-?/', $orig_url)) {
include_once('tiki-sefurl.php');
$orig_url = filter_out_sefurl(preg_replace('#(.*)\/cat([0-9]+)(.*)#', '/tiki-browse_categories.php?parentId=$2$3', $orig_url), $smarty, 'category');
} elseif (preg_match('/article[0-9]+-?/', $orig_url)) {
$orig_url = preg_replace('#\/article([0-9]+)(.*)#', '/tiki-read_article.php?articleId=$1', $orig_url);
} else {
$orig_url = preg_replace('#\/([^\/]+)$#', '/tiki-index.php?page=$1', $orig_url);
}
}
if (!strstr($orig_url, '.php')) {
} elseif (!strstr($orig_url, '.php')) {
$params = parse_url($orig_url);
if (empty($params['query']))
$orig_url = $prefs['tikiIndex'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment