@sgiehl opened this Pull Request on July 23rd 2018 Member

fixes #13113

@diosmosis commented on July 23rd 2018 Member

Shouldn't the parameter be encoded automatically in ajax requests? Seems like this would double encode it (which should work because matomo handles it specifically, but it seems like a fix that could cause problems later). Maybe we should be urlencoding the values that can have spaces when adding the segment label?

@fdellwing commented on July 24th 2018 Contributor

Left a comment at #13113

@mattab commented on July 24th 2018 Member

@sgiehl do you maybe have an idea about how to fix https://github.com/matomo-org/matomo/issues/11806 which is similar?

@mattab commented on August 1st 2018 Member

Shouldn't the parameter be encoded automatically in ajax requests?

Yes, but then i see this code:


        // we took care of encoding &segment properly already, so we don't use $.param for it ($.param URL encodes the values)
        if(parameters['segment']) {
            url += 'segment=' + parameters['segment'] + '&';
            delete parameters['segment'];
        }

so the segment parameter is a special case/hack and not URL encoded as it's assumed by our Ajax helper that the value is already properly URL encoded. so URL encoding it manually as done in this PR is needed it seems...

This Pull Request was closed on August 1st 2018
Powered by GitHub Issue Mirror