New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in parsing of Custom Variables #3090
Comments
Thanks for the report |
Attachment: Patch for this issue. |
I uploaded a patch for this issue. Its small, but modifies getRequestVar, so I think it should be reviewed. Let me know what you think. |
Thanks for yourpatch!
|
(In [6367]) Fixes #3090, added 'json' request parameter type & related tests. |
(In [6374]) Refs #3090 test build |
(In [6377]) Refs #3090 test build |
(In [6378]) Refs #3090 Maybe the problem comes from when the PHP implementation of json_decode is used? since it passes on capedbuzz+ my laptop but not on CI...! |
(In [6386]) Refs #3090 test using native json_decode rather than fallback as there might be a bug in the php implementation |
(In [6388]) Refs #3090 test build |
(In [6392]) Do we really need a stripslashes for JSON data? really surprising?? Refs #3090 - could it be a magic quote issue? |
(In [6395]) Refs #3090 if this fix works, for sure it will be ugly ;) |
(In [6398]) Refs #3090
|
There is a bug in parsing Custom Variables, basically I have something like this on my site:
piwikTracker.setCustomVariable(
2,
"Entry",
'Random Title - " Foobar "',
"page"
);
which will be json encoded as:
{"2":Title - " Foobar ""}
what will happen is that in Tracker/Visit.php piwik will get this from the "cvar" parameter, then sanitize and unsanitize it, after which it looks like:
{"2":Title - " Foobar ""}
this gets then passed to json_decode which fails to parse it due to the wrongly replaced double quotes.
to reproduce just use the piwikTracker.setCustomVariable call similar to above that has " in it.
The text was updated successfully, but these errors were encountered: