[TYPO3-core] RFC #16321: Bug: Numeric zero for representation of weekday sunday is not accepted

Marcus Krause marcus#exp2010 at t3sec.info
Wed Nov 10 12:27:16 CET 2010


Hi!

Christian Kuhn schrieb am 11/10/2010 01:55 AM Uhr:
> On 11/09/2010 11:05 PM, Marcus Krause wrote:
>> Problem:
>> Currently, the scheduler accepts single numeric values only for
>> representation of weekdays. Lower bound and included is 1, upper bound
>> and included in range is 7. 1 means Monday, 7 Sunday.
>>
>> However, even the currently reduced functionality is not fully
>> compatible with an usual cron entry. Usually numeric zero is also
>> allowed representing Sunday.
>>
>> Solution:
>> Allow '0' for sunday.
> 
> +1 on reading.
> 
> Nitpick:
> + if (0 === strcmp($weekday, '0')) {
> 
> Please swap variable and constant.
> This is a "Yoda condition": "If blue is the sky" :) [1]

The empire strikes back; attached is v1 taking your note into account.
I've additionally added the unchanged unit test for completeness.


Marcus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16321_v1.diff
Type: text/x-diff
Size: 1516 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101110/f29a2f79/attachment-0002.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16321-test.diff
Type: text/x-diff
Size: 948 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101110/f29a2f79/attachment-0003.diff>


More information about the TYPO3-team-core mailing list