1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Filter social network tracking queries when determining SEF route.

This commit is contained in:
Cameron
2019-01-23 14:21:59 -08:00
parent f387fa149f
commit 9237f254c7

View File

@@ -524,7 +524,7 @@ class eFront
if(!empty($status[0]) && ($status[0] === '{'))
{
$status = e107::getParser()->replaceConstants($status);
}
}
self::$_legacy = $status;
}
return self::$_legacy;
@@ -1027,6 +1027,9 @@ class eRouter
* @var string
*/
public $notFoundUrl = 'system/error/404?type=routeError';
protected $_trackers = array('fbclid','utm_source','utm_medium','utm_content','utm_campaign');
public function __construct()
{
@@ -1085,6 +1088,12 @@ class eRouter
{
return $this->_urlFormat;
}
public function getTrackers()
{
return $this->_trackers;
}
/**
* Load config and url rules, if not available - build it on the fly
@@ -1792,9 +1801,23 @@ class eRouter
$rawPathInfo = rawurldecode($request->getPathInfo());
//$this->_urlFormat = self::FORMAT_PATH;
}
// Ignore social trackers when determining route.
$get = $_GET;
$trackers = $this->getTrackers();
foreach($trackers as $val)
{
if(isset($get[$val]))
{
unset($get[$val]);
}
}
// Route to front page - index/index/index route
if(!$rawPathInfo && (!$this->getMainModule() || empty($_GET)))
if(!$rawPathInfo && (!$this->getMainModule() || empty($get)))
{
// front page settings will be detected and front page will be rendered
$request->setRoute('index/index/index');