BUGFIX] strftime expects parameter 2 to be long, string given
authorJigal van Hemert <jigal@xs4all.nl>
Fri, 7 Sep 2012 17:50:47 +0000 (19:50 +0200)
committerJigal van Hemert <jigal@xs4all.nl>
Tue, 11 Sep 2012 18:11:58 +0000 (20:11 +0200)
Any zero length string value is replaced with the current timestamp.
(Just like the default value for the second parameter of
strtime/gmstrftime.)

Change-Id: I7cc43a09f75d21ab8db84c0191fa0c1c5d67ddb0
Fixes: #38717
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/12713
Reviewed-by: Stefan Neufeind
Reviewed-by: Marcus Schwemer
Tested-by: Marcus Schwemer
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 6d8e6c9..2136a82 100644 (file)
@@ -2573,6 +2573,8 @@ class ContentObjectRenderer {
         * @return string The processed input value
         */
        public function stdWrap_strftime($content = '', $conf = array()) {
+                       // Check for zero length string to mimic default case of strtime/gmstrftime
+               $content = $content == '' ? $GLOBALS['EXEC_TIME'] : intval($content);
                $content = $conf['strftime.']['GMT'] ? gmstrftime($conf['strftime'], $content) : strftime($conf['strftime'], $content);
                $tmp_charset = $conf['strftime.']['charset'] ? $conf['strftime.']['charset'] : $GLOBALS['TSFE']->localeCharset;
                if ($tmp_charset) {