Skip to content
Extraits de code Groupes Projets
Valider d838d79d rédigé par Cyril Bay's avatar Cyril Bay
Parcourir les fichiers

Refs #703 Better handling of query strings.

git-svn-id: http://dev.piwik.org/svn/trunk@6271 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 64e233bc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -951,10 +951,15 @@ class Recorder(object): ...@@ -951,10 +951,15 @@ class Recorder(object):
stats.dates_recorded.add(hit.date.date()) stats.dates_recorded.add(hit.date.date())
if config.options.strip_query_string:
path = hit.path
else:
path = '%s%s%s' % (hit.path, config.options.query_string_delimiter, hit.query_string)
args = { args = {
'rec': '1', 'rec': '1',
'apiv': '1', 'apiv': '1',
'url': (main_url + hit.path[:1024]).encode('utf8'), 'url': (main_url + path[:1024]).encode('utf8'),
'urlref': hit.referrer[:1024].encode('utf8'), 'urlref': hit.referrer[:1024].encode('utf8'),
'cip': hit.ip, 'cip': hit.ip,
'cdt': self.date_to_piwik(hit.date), 'cdt': self.date_to_piwik(hit.date),
...@@ -1172,21 +1177,11 @@ class Parser(object): ...@@ -1172,21 +1177,11 @@ class Parser(object):
is_redirect=False, is_redirect=False,
) )
hit.path = hit.full_path try:
if config.options.strip_query_string: hit.query_string = match.group('query_string')
try: hit.path = hit.full_path
query_string = match.group('query_string') except IndexError:
except IndexError: hit.path, hit.query_string = hit.full_path.split(config.options.query_string_delimiter, 1)
# Strip the query string
hit.path = hit.full_path.split(config.options.query_string_delimiter, 1)[0]
else:
try:
query_string = match.group('query_string')
except IndexError:
pass
else:
# Merge the query string
hit.path = '%s%s%s' % (hit.full_path, config.options.query_string_delimiter, query_string)
# Parse date # Parse date
date_string = match.group('date') date_string = match.group('date')
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter