5821[BUGFIX] date expects parameter 2 to be long, string given
Commit message
Review
-
Code review CR +2
- Jigal van Hemert +2
- Björn Pedersen +1
- Simon Schaufelberger +1
-
Verified V +2
- Jigal van Hemert +2
- Simon Schaufelberger +1
Files 1
Review log 58
Show 33 earlier messages
-
Jigal van Hemert merged patch set 1 10/18/11, 13:46
-
Markus Klein commented on patch set 1 10/18/11, 13:46
(1 inline comment) -
Markus Klein commented on patch set 1 10/18/11, 13:46
(1 inline comment) -
Jigal van Hemert commented on patch set 1 10/18/11, 13:46
(1 inline comment) Both gmdate and date will convert the second parameter to an int much like intval() does. Only completely non-numeric values (empty string, string starting with letters, etc.) will trigger the warning. Why not simply use $content = intval($content); to turn anything which cannot be seen as a number into zero? -
Simon Schaufelberger commented on patch set 1 10/18/11, 13:46
the problem is then dat date is called with 0 and a timestamp with 0 is 0. -> date('U', 0) -
Markus Klein commented on patch set 3 10/18/11, 13:46
Looks good to me, but someone else must approve -
Jigal van Hemert uploaded patch set 3 10/18/11, 13:46
-
Jigal van Hemert commented on patch set 3 10/18/11, 13:46
@Simon: I just found that date/gmdate can deal with a lot more values. Leading whitespace is trimmed away, leading + is no problem, hexadecimal values can be used, anything which starts with an integer (plus all the previous variations) can be used. Strings like 'whatever' produce the warning about parameter 2, not only empty strings. To remove the warnings we should properly test for values which are accepted by date/gmdate. -
Jigal van Hemert commented on patch set 3 10/18/11, 13:46
I would prefer that you didn't submit this A quick vote also against my own version. See bugtracker for a more complete reasoning. -
Dmitry Dulepov commented on patch set 4 10/18/11, 13:46
I would prefer that you didn't submit this Why do we need all this complexity? Just check if content is empty or not. If it is truly empty, use time(), if not, use intval() and that's it. Who needs 0x4e9bf46f in TypoScript for the data value? Nobody. There is no need to complicate it that much :) -
Dmitry Dulepov commented on patch set 4 10/18/11, 13:46
Yes. It is very logical, simple and rock stable. -
Markus Klein commented on patch set 4 10/18/11, 13:46
I would prefer that you didn't submit this Please see my remarks in forge. -
Markus Klein uploaded patch set 5 10/18/11, 13:46
-
Markus Klein commented on patch set 5 10/18/11, 13:46
I would prefer that you didn't submit this will add another patch with comments -
Dmitry Dulepov commented on patch set 6 10/18/11, 13:46
(1 inline comment) See inline notes. -
Markus Klein commented on patch set 6 10/18/11, 13:46
No score @Georg: I know that, but it's not my patch! Look at the author first before complaining, please. Will include your suggestion in the next version. -
Markus Klein uploaded patch set 6 10/18/11, 13:46
-
Markus Klein commented on patch set 6 10/18/11, 13:46
Looks good to me, but someone else must approve -
Björn Pedersen commented on patch set 7 10/18/11, 13:46
Looks good to me, but someone else must approve -
Markus Klein commented on patch set 7 10/18/11, 13:46
"doing things just because it has been done before is not always correct" I fully agree! In this case I didn't introduce the change in the header, so I stick to the opinion of the RM. Maybe we should put a task on forge to rework all function documentation for stdWrap. Thx so far. -
Markus Klein commented on patch set 7 10/18/11, 13:46
He responded this in Set 6: well, all input values are strings in those stdWrap methods and default value is ='' which is not an integer :) So please convert your -1 to a +1 if you don't have any further objections. Thanks. ;-) -
Markus Klein uploaded patch set 7 10/18/11, 13:46
-
Xavier Perseguers commented on patch set 4 10/18/11, 13:46
Hi. Here's my decision :) - intval() the value if it's not empty - take time() if empty In short: if ($content === '') $content = time(); else $content = intval($content); Meaning il will work with ' 1234' (converted to 1234 which is expected) but will be set to zero (0) for exotic values (' 0xFFyy') and will only be set to current timestamp if explicitly empty. Please take possible other nitpicking on that "version" of the patch into account though, did not read all versions into details. Thanks. -
Xavier Perseguers commented on patch set 4 10/18/11, 13:46
According to TSref, they have the power to transform that with prioriCalc and many other functions. The intval (which can of course be set explicitly in TS) should act as a safeguard for the date function itself. An invalid TS should not lead to improper data sent to PHP. That's my opinion. -
Xavier Perseguers commented on patch set 6 10/18/11, 13:46
(2 inline comments) -
Georg Ringer commented on patch set 6 2 comments 10/18/11, 13:46
I would prefer that you didn't submit this you are not alllowed to vote for your own patches ... -
Georg Ringer commented on patch set 7 10/18/11, 13:46
this patch is for master branch, of course it can't be in 4-5! -
Georg Ringer commented on patch set 7 10/18/11, 13:46
you can of course backport it yourself too, @see http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine#Backporting_a_change_to_other_branches -
Georg Ringer commented on patch set 7 10/18/11, 13:46
I would prefer that you didn't submit this -
Georg Ringer commented on patch set 7 10/18/11, 13:46
if you touch lines, you should do it correctly -
Georg Ringer commented on patch set 7 10/18/11, 13:46
if the doc is touched and it is wrong, it needs to be corrected. date/gmdate expect integers, therefore this function expects integers. as "Input value undergoing processing in this function." is used in this class all the time I am fine if this is not changed. -
Georg Ringer commented on patch set 7 10/18/11, 13:46
No score it is a public method, so it can be called from anywhere. doing things just because it has been done before is not always correct but however, reverted to +-0 -
Georg Ringer commented on patch set 7 10/18/11, 13:46
but it is ok if the RM overrules me ;)
-
Jigal van Hemert uploaded patch set 4 10/18/11, 13:46
-
Jigal van Hemert commented on patch set 7 10/18/11, 13:46
@Georg: Any reason for the -1?? -
Jigal van Hemert commented on patch set 7 V 0 10/18/11, 13:46
by team member; Looks good to me, approved Needs +1's from anyone (plus submit), then it can go to 4.5, 4.4 (if RMs agree) -
Simon Schaufelberger uploaded patch set 2 10/18/11, 13:46
-
Simon Schaufelberger commented on patch set 3 10/18/11, 13:46
@Jigal: could you please share a typoscript snippet why my second patch does not work? -
Simon Schaufelberger commented on patch set 3 10/18/11, 13:46
Verified; Looks good to me, but someone else must approve should I write some unit tests for that? -
Simon Schaufelberger commented on patch set 4 10/18/11, 13:46
the core team should decide what they want. i am fine with patch 2. -
Simon Schaufelberger commented on patch set 4 10/18/11, 13:46
I would not do the intval, people setting up the ts should care by themself that the put in the correct value as second parameter to the date function. Then they are free to use the exotic values as well ;) -
Simon Schaufelberger commented on patch set 4 10/18/11, 13:46
Looks good to me, but someone else must approve Looks good to me but not tested everything... -
Simon Schaufelberger commented on patch set 4 10/18/11, 13:46
No score so you mean we should use patch 2? -
Simon Schaufelberger commented on patch set 6 10/18/11, 13:46
Verified; Looks good to me, but someone else must approve -
Simon Schaufelberger commented on patch set 7 10/18/11, 13:46
as mentioned in my commit message, this patch should go into 4.6, 4.5, 4.4 -
Simon Schaufelberger commented on patch set 7 10/18/11, 13:46
awesome, please also add to other branches! -
Simon Schaufelberger commented on patch set 7 10/18/11, 13:46
can somebody please backport it? -
Simon Schaufelberger commented on patch set 7 10/18/11, 13:46
Oh no, this patch is NOT in... http://wiki.typo3.org/wiki/TYPO3_4.5.7#Changelog -
Simon Schaufelberger commented on patch set 7 10/18/11, 13:46
@Georg: maybe you should explain what you mean by "correctly" -
Simon Schaufelberger commented on patch set 7 10/18/11, 13:46
Verified; Looks good to me, but someone else must approve -
Mr. Jenkins commented on patch set 1 10/18/11, 13:46
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/2147/ : SUCCESS -
Mr. Jenkins commented on patch set 2 10/18/11, 13:46
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/2148/ : SUCCESS -
Mr. Jenkins commented on patch set 3 10/18/11, 13:46
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/2149/ : SUCCESS -
Mr. Jenkins commented on patch set 4 10/18/11, 13:46
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/2152/ : SUCCESS -
Mr. Jenkins commented on patch set 5 10/18/11, 13:46
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/2157/ : SUCCESS -
Mr. Jenkins commented on patch set 6 10/18/11, 13:46
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/2158/ : SUCCESS -
Mr. Jenkins commented on patch set 7 10/18/11, 13:46
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/2159/ : SUCCESS -
Markus Klein commented on patch set 7 10/18/11, 13:46
class.tslib_content.php:2429