diff options
Diffstat (limited to 'core/Tracker/Action.php')
-rw-r--r-- | core/Tracker/Action.php | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php index e2641f35f1..f7a9445058 100644 --- a/core/Tracker/Action.php +++ b/core/Tracker/Action.php @@ -65,8 +65,6 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface private $actionType; private $actionUrl; - static private $queryParametersToExclude = array('phpsessid', 'jsessionid', 'sessionid', 'aspsessionid'); - public function setRequest($requestArray) { $this->request = $requestArray; @@ -119,54 +117,17 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface protected function setActionName($name) { - $name = $this->truncate($name); $this->actionName = $name; } - protected function setActionType($type) { $this->actionType = $type; } - protected function setActionUrl($url) { - $url = self::excludeQueryParametersFromUrl($url, $this->idSite); - $url = $this->truncate($url); $this->actionUrl = $url; } - static public function excludeQueryParametersFromUrl($originalUrl, $idSite) - { - $website = Piwik_Common::getCacheWebsiteAttributes( $idSite ); - $originalUrl = Piwik_Common::unsanitizeInputValue($originalUrl); - $parsedUrl = @parse_url($originalUrl); - if(empty($parsedUrl['query'])) - { - return $originalUrl; - } - $excludedParameters = isset($website['excluded_parameters']) ? $website['excluded_parameters'] : array(); - $parametersToExclude = array_merge($excludedParameters, self::$queryParametersToExclude); - - $parametersToExclude = array_map('strtolower', $parametersToExclude); - $queryParameters = Piwik_Common::getArrayFromQueryString($parsedUrl['query']); - - $validQuery = ''; - $separator = '&'; - foreach($queryParameters as $name => $value) - { - if(!in_array(strtolower($name), $parametersToExclude)) - { - $validQuery .= $name.'='.$value.$separator; - } - } - $parsedUrl['query'] = substr($validQuery,0,-strlen($separator)); - $url = Piwik_Common::getParseUrlReverse($parsedUrl); - printDebug('Excluded parameters "'.implode(',',$excludedParameters).'" from URL. - Before was <br/><code>"'.$originalUrl.'"</code>, <br/> - After is <br/><code>"'.$url.'"</code>'); - return $url; - } - public function init() { $info = $this->extractUrlAndActionNameFromRequest(); @@ -175,12 +136,6 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface $this->setActionUrl($info['url']); } - protected function truncate( $label ) - { - $limit = Piwik_Tracker_Config::getInstance()->Tracker['page_maximum_length']; - return substr($label, 0, $limit); - } - /** * Loads the idaction of the current action name and the current action url. * These idactions are used in the visitor logging table to link the visit information @@ -333,10 +288,8 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface $actionType = self::TYPE_ACTION_URL; $url = Piwik_Common::getRequestVar( 'url', '', 'string', $this->request); - // get the delimiter, by default '/'; BC, we read the old action_category_delimiter first (see #1067) - $actionCategoryDelimiter = isset(Piwik_Tracker_Config::getInstance()->General['action_category_delimiter']) - ? Piwik_Tracker_Config::getInstance()->General['action_category_delimiter'] - : Piwik_Tracker_Config::getInstance()->General['action_url_category_delimiter']; + // get the delimiter, by default '/' + $actionCategoryDelimiter = Piwik_Tracker_Config::getInstance()->General['action_category_delimiter']; // create an array of the categories delimited by the delimiter $split = explode($actionCategoryDelimiter, $actionName); |