@tsteur opened this Issue on October 2nd 2019 Member

While testing https://github.com/matomo-org/matomo/pull/14884 I noticed an error in the segment editor. Likely it's a regression.

It fails with the error

angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:123 URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at findAndExplodeByMatch (segmentgenerator.controller.js?cb=21177de8310fa51319dd14c492d0bdea:50)
    at SegmentGeneratorController.setSegmentString (segmentgenerator.controller.js?cb=21177de8310fa51319dd14c492d0bdea:262)
    at SegmentGeneratorController (segmentgenerator.controller.js?cb=21177de8310fa51319dd14c492d0bdea:273)
    at Object.invoke (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:44)
    at O.instance (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:94)
    at q (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:69)
    at angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:81
    at angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:136
    at m.$digest (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:147)

in plugins/SegmentEditor/angularjs/segment-generator/segmentgenerator.controller.js around line 50 where the value of newMetric is {"segment":"browserCode","matches":"==","value":"<'>/\"#$I*%"}

image

In the DB I have the segment defined like this

INSERT INTO `piwik_segment` (`idsegment`, `name`, `definition`, `login`, `enable_all_users`, `enable_only_idsite`, `auto_archive`, `ts_created`, `ts_last_edit`, `deleted`)
VALUES
    (28, '&lt;&<a href='/039'>#039</a>;&gt;/&quot;#$I*%', 'browserCode==%3C%27%3E%2F%22%23%24I*%25', 'root', 0, 1, 0, '2016-09-29 10:36:08', '2016-09-29 11:36:22', 0);

I suppose the problem is that the value might be decoded twice? not sure. When I debug it does the decode twice though (if (minPos < metric.length) {)

image

This Issue was closed on October 7th 2019
Powered by GitHub Issue Mirror