diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-12-22 06:42:08 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-12-22 06:42:08 +0300 |
commit | 08d623c7ee5b67d779454f179bfacc71a295ab73 (patch) | |
tree | a8ddd06677a52a89eb43c1015c6296f47db5d57c /plugins/Actions | |
parent | b488f6278658f367e90daa8156f6522e836ba0e1 (diff) |
Prepend whitespace to action for BC so same title does not appear twice (#13895)
* Prepend whitespace to action for BC so same title does not appear twice
* fix tests
Diffstat (limited to 'plugins/Actions')
-rw-r--r-- | plugins/Actions/ArchivingHelper.php | 2 | ||||
-rw-r--r-- | plugins/Actions/tests/Unit/ArchiverTest.php | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Actions/ArchivingHelper.php b/plugins/Actions/ArchivingHelper.php index e484749273..ce28c445a2 100644 --- a/plugins/Actions/ArchivingHelper.php +++ b/plugins/Actions/ArchivingHelper.php @@ -447,7 +447,7 @@ class ArchivingHelper if ($name === '' || $name === false || $name === null || trim($name) === '') { $name = self::getUnknownActionName($type); } - return array(trim($name)); + return array(' ' . trim($name)); } $name = self::parseNameFromPageUrl($name, $type, $urlPrefix); diff --git a/plugins/Actions/tests/Unit/ArchiverTest.php b/plugins/Actions/tests/Unit/ArchiverTest.php index e1f93cab75..8098e5fe0f 100644 --- a/plugins/Actions/tests/Unit/ArchiverTest.php +++ b/plugins/Actions/tests/Unit/ArchiverTest.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -namespace Piwik\Plugins\PrivacyManager\tests\Unit; +namespace Piwik\Plugins\Actions\tests\Unit; use Piwik\Plugins\Actions\ArchivingHelper; use Piwik\Tracker\Action; @@ -80,19 +80,19 @@ class ArchiverTests extends \PHPUnit_Framework_TestCase ), array( 'params' => array('name' => 'Category / Subcategory', 'type' => Action::TYPE_PAGE_TITLE), - 'expected' => array('Category / Subcategory'), + 'expected' => array(' Category / Subcategory'), ), array( 'params' => array('name' => '/path/index.php?var=test', 'type' => Action::TYPE_PAGE_TITLE), - 'expected' => array('/path/index.php?var=test'), + 'expected' => array(' /path/index.php?var=test'), ), array( 'params' => array('name' => 'http://example.org/path/Default.aspx#anchor', 'type' => Action::TYPE_PAGE_TITLE), - 'expected' => array('http://example.org/path/Default.aspx#anchor'), + 'expected' => array(' http://example.org/path/Default.aspx#anchor'), ), array( 'params' => array('name' => '', 'type' => Action::TYPE_PAGE_TITLE), - 'expected' => array('Page Name not defined'), + 'expected' => array(' Page Name not defined'), ), array( 'params' => array('name' => '', 'type' => Action::TYPE_PAGE_URL), |