@taru18 opened this Issue on November 18th 2022

Expected Behavior

User should be able to use lower/greater than signs (< >) in segment names.
The pages report should show performance reports whether a segment is in use or not.

Current Behavior

When selecting Performance icon from Pages report when segment is being used, the UI gives an error:
"Error: The segment condition 'actions&gt' is not valid." After this the menu disappears, too.

We found out that if the segment contains a suitable condition such as greater than (>), then the url will contain that character as html-encoded ( & gt; ) and the url of the user interface link will be broken with a semicolon. This only happens from the pages report when clicking the performance icon.

Steps to Reproduce (for Bugs)

  • Rename a segment so it has lower than or greater than sign in the name.
  • Select Performance icon from Pages while also using the renamed segment.

Your Environment

PHP version: 8.0.22
MySQL version: 10.1.36-MariaDB
Matomo version: 4.10.1

@bx80 commented on November 21st 2022 Contributor

Thanks for reporting this @taru18, I can confirm this issue :+1:

ERROR Piwik\ExceptionHandler[2022-11-21 00:26:02 UTC] [11671] Uncaught exception: /var/www/matomo/core/Segment/SegmentExpression.php(119): The segment condition 'continentCode&gt' is not valid. [Query: ?segment=continentCode%3E%3Deur&date=2022-10-23&module=PagePerformance&action=indexPagePerformance&apiMethod=Actions.getPageUrls&label=%2540%252Foptoutjs2.html&idSite=1&period=year, CLI mode: 0]
@sgiehl commented on November 21st 2022 Member

Looks like the parameter is sanitized too often somewhere. I'll have a quick look and set up a PR if it's easy to fix.

This Issue was closed on December 1st 2022
Powered by GitHub Issue Mirror