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
diff options
context:
space:
mode:
authorsgiehl <stefan@piwik.org>2015-07-27 18:30:25 +0300
committersgiehl <stefan@piwik.org>2015-09-25 21:07:49 +0300
commitd4cfacee0a96f54efcecef1a725451b96abd8d3b (patch)
tree64b30c51544db15d028eab7aac12aabefb72cdcf /core/Date.php
parentf60ad71df1765498f0c21789d5c55ab7218192e1 (diff)
replace legacy placeholders only if indicator (%) is present
Diffstat (limited to 'core/Date.php')
-rw-r--r--core/Date.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/Date.php b/core/Date.php
index a47fc03c73..bac8ce7db2 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -659,6 +659,10 @@ class Date
*/
protected function replaceLegacyPlaceholders($template)
{
+ if (strpos($template, '%') === false) {
+ return $template;
+ }
+
$mapping = array(
'%day%' => 'd',
'%shortMonth%' => 'MMM',
@@ -774,7 +778,13 @@ class Date
);
/**
- * Parses the datetime format pattern.
+ * Parses the datetime format pattern and returns a tokenized result array
+ *
+ * Examples:
+ * Input Output
+ * 'dd.mm.yyyy' array(array('dd'), '.', array('mm'), '.', array('yyyy'))
+ * 'y?M?d?EEEE ah:mm:ss' array(array('y'), '?', array('M'), '?', array('d'), '?', array('EEEE'), ' ', array('a'), array('h'), ':', array('mm'), ':', array('ss'))
+ *
* @param string $pattern the pattern to be parsed
* @return array tokenized parsing result
*/