@walokra opened this Issue on September 10th 2019

When using Reporting API and i.a. Actions.getPageUrls report it returns JSON data which can be invalid if the label field has backslash. The backslash is correctly encoded to %5C in url and pageUrl elements but not in label. Matomo version 3.11.0.

e.g.
{"label":"\/search?p=0&q=\&sl=false","nb_visits":17,"nb_hits":17,"sum_time_spent":32,"nb_hits_with_time_generation":17,"min_time_generation":"0.244","max_time_generation":"0.549","sum_daily_nb_uniq_visitors":17,"avg_time_on_page":2,"bounce_rate":"0%","exit_rate":"0%","avg_time_generation":0.407,"url":"https:\/\/example.com\/search?p=0&q=%5C&sl=false","segment":"pageUrl==https%3A%2F%2Fexample.com%search%3Fp%3D0%26q%3D%5C%26sl%3Dfalse"}

@tsteur commented on September 10th 2019 Member

Thanks, the JSON looks valid but the backslash in the label looks removed indeed.

@walokra commented on September 11th 2019

Seems that Github removed the backslash in the JSON. Fixed it now and that JSON isn't valid. Backslashes in label field should be also escaped like forward slash is, i.e. "label":"\/search?p=0&q=\&sl=false".

@tsteur commented on September 11th 2019 Member

image

This is the JSON I'm getting. {"label":"54?4545=55&\\\u00a7$3434e<",

Just checking: Are you sure you're looking at the raw data of the API response? Tested with the same URL I'm getting this:
image

Powered by GitHub Issue Mirror