Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/API
diff options
context:
space:
mode:
authordiosmosis <benakamoorthi@fastmail.fm>2014-06-27 10:48:13 +0400
committerdiosmosis <benakamoorthi@fastmail.fm>2014-06-27 10:48:53 +0400
commit37c2d8d9be1cd2115d977f32c2120c956212e76d (patch)
tree9ba4bae884c929c60b7ab95eb3d7936fb1ab72fc /core/API
parente78509bc5f8dcee6ba5a1e36c0d494bcc0440ecb (diff)
Refs #4363, add workaround to fix bug where leaf rows of page titles reports were not accessible via RowEvolution.
Diffstat (limited to 'core/API')
-rw-r--r--core/API/DataTableManipulator/LabelFilter.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/core/API/DataTableManipulator/LabelFilter.php b/core/API/DataTableManipulator/LabelFilter.php
index 20c3ccd430..ecfcb1e886 100644
--- a/core/API/DataTableManipulator/LabelFilter.php
+++ b/core/API/DataTableManipulator/LabelFilter.php
@@ -111,15 +111,15 @@ class LabelFilter extends DataTableManipulator
* Note: The HTML Encoded version must be tried first, since in ResponseBuilder the $label is unsanitized
* via Common::unsanitizeLabelParameter.
*
- * @param string $label
+ * @param string $originalLabel
* @return array
*/
- private function getLabelVariations($label)
+ private function getLabelVariations($originalLabel)
{
static $pageTitleReports = array('getPageTitles', 'getEntryPageTitles', 'getExitPageTitles');
$variations = array();
- $label = urldecode($label);
+ $label = urldecode($originalLabel);
$label = trim($label);
$sanitizedLabel = Common::sanitizeInputValue($label);
@@ -128,10 +128,17 @@ class LabelFilter extends DataTableManipulator
if ($this->apiModule == 'Actions'
&& in_array($this->apiMethod, $pageTitleReports)
) {
- // special case: the Actions.getPageTitles report prefixes some labels with a blank.
- // the blank might be passed by the user but is removed in Request::getRequestArrayFromString.
- $variations[] = ' ' . $sanitizedLabel;
- $variations[] = ' ' . $label;
+ // temporary workaround for #4363, if a '+' is at the end of this label, we assume it is a
+ // terminal label and only check for a terminal row.
+ if (substr($originalLabel, -1) == '+') {
+ array_unshift($variations, ' ' . $sanitizedLabel);
+ array_unshift($variations, ' ' . $label);
+ } else {
+ // special case: the Actions.getPageTitles report prefixes some labels with a blank.
+ // the blank might be passed by the user but is removed in Request::getRequestArrayFromString.
+ $variations[] = ' ' . $sanitizedLabel;
+ $variations[] = ' ' . $label;
+ }
}
$variations[] = $label;