Review main Merged

35530[BUGFIX] Fix fatal error for date validation in EXT:form on Windows

Stephan Großberndt CR +2 V +2 Easy +25 −5 updated 01/19/15, 21:44

Commit message

Use a mapping to date_create_from_format() in date validation of
EXT:form if strptime() is not available. This prevents a fatal error on
Windows because strptime() is not implemented on Windows platform.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Markus Klein +1
  • Verified V +2
    • Christian Kuhn +2
    • Markus Klein +1

Issues 1

Files 1

Review log 15

  1. Stephan Großberndt uploaded patch set 1 12/17/14, 00:56

  2. Stephan Großberndt uploaded patch set 2 12/17/14, 01:30

  3. Stephan Großberndt updated the commit message in patch set 3 12/17/14, 11:14

  4. Jigal van Hemert commented on patch set 3 12/17/14, 13:07

    DateValidator.php:80

    Why not unify the method and use the far more reliable date_create_from_format() (or the OO version?) on all platforms?
  5. Stephan Großberndt commented on patch set 3 12/17/14, 13:43

    DateValidator.php:80 Reply

    Because date_create_from_format does not work with localized textual representations of days/month and the given conversions on windows are only a subset of the possible conversions. DateTime::createFromFormat() provides much fewer formatting options than strftime. http://php.net/manual/de/function.strptime.php http://php.net/manual/de/function.strftime.php http://php.net/manual/de/function.date-parse-from-format.php Switching to DateTime::createFromFormat() in general would mean no localized text representations too. I first used DateTime::createFromFormat() but mysteriously got the error Validation\DateValidator\DateTime could not be found. date_create_from_format() does the same and is a bit shorter ;)
  6. Mathias Schreiber wrote 12/17/14, 14:33

    Topic set to EXT: form
  7. Jigal van Hemert commented on patch set 3 12/17/14, 20:10

    DateValidator.php:80 Reply

    Unbelievable :-( DateTime is a lot better in handling a wider range of dates but only supports English names for days and months. I think we have to find a general solution for handling dates and times.
  8. Stephan Großberndt commented on patch set 3 01/04/15, 13:48

    I know this is suboptimal but the missing function fatals every execution of the unit tests in typo3/sysext/core/Build/UnitTests.xml Creating a good solution for date- and time-handling is more of an epic task than a bugfix. support on linux/unix stays exactly the same, on windows you have at least a support for english and non-textual support for foreign languages.
  9. Stephan Großberndt updated the commit message in patch set 4 01/05/15, 13:57

  10. Markus Klein commented on patch set 4 CR +1 01/19/15, 21:37

    Looks good IMO
  11. Christian Kuhn voted on patch set 4 CR +1 V +1 01/19/15, 21:41

  12. Markus Klein voted on patch set 4 V +1 01/19/15, 21:43

  13. Christian Kuhn voted on patch set 4 CR +2 V +2 01/19/15, 21:43

  14. Christian Kuhn merged patch set 4 01/19/15, 21:43

  15. Christian Kuhn commented on patch set 5 01/19/15, 21:44

    Cherry Picked This patchset was cherry picked to branch TYPO3_6-2 as commit 2963c1609cdb4137e5d8610c2aae900dba87d986