Actions
Bug #30931
closeddate() expects parameter 2 to be long, string given in class.tslib_content.php
Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2011-10-14
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
4.6
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
I have the following typoscript (part of a sql string)
20 = TEXT 20.date = U 20.noTrimWrap = | AND date > ||
and i get the following warning message:
Warning: date() expects parameter 2 to be long, string given in /typo3/sysext/cms/tslib/class.tslib_content.php on line 2529
content should NEVER be a string by default here, it as written in the php docs:
string gmdate ( string $format [, int $timestamp = time() ] )
it shold be an int.
public function stdWrap_date($content = '', $conf = array()) { $content = ($conf['date.']['GMT'] ? gmdate($conf['date'], $content) : date($conf['date'], $content)); return $content; }
for me the code should be something like:
public function stdWrap_date($content = '', $conf = array()) { if ($content !== '') { $content = ($conf['date.']['GMT'] ? gmdate($conf['date'], $content) : date($conf['date'], $content)); } else { $content = ($conf['date.']['GMT'] ? gmdate($conf['date']) : date($conf['date'])); } return $content; }
Actions