mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Filter social network tracking queries when determining SEF route.
This commit is contained in:
@@ -1028,6 +1028,9 @@ class eRouter
|
||||
*/
|
||||
public $notFoundUrl = 'system/error/404?type=routeError';
|
||||
|
||||
protected $_trackers = array('fbclid','utm_source','utm_medium','utm_content','utm_campaign');
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_init();
|
||||
@@ -1086,6 +1089,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
|
||||
* @return eRouter
|
||||
@@ -1793,8 +1802,22 @@ class eRouter
|
||||
//$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');
|
||||
|
Reference in New Issue
Block a user