Fix regular expression in DateUtil::validateDate()
authorTim Düsterhus <timwolla@googlemail.com>
Wed, 12 Mar 2014 19:49:00 +0000 (20:49 +0100)
committerTim Düsterhus <timwolla@googlemail.com>
Wed, 12 Mar 2014 19:49:00 +0000 (20:49 +0100)
see 59351a802d94c6866a4e2d6ccb04204fcc9e199a

wcfsetup/install/files/lib/util/DateUtil.class.php

index 6caf8359ed975701a02fb0c13d5cfb8bea940a0e..7f8b6930cc8f9038926eccca223c7b954aef916c 100644 (file)
@@ -357,7 +357,7 @@ final class DateUtil {
         * @param       string          $date
         */
        public static function validateDate($date) {
-               if (preg_match('~^(?<year>[0-9]{4})-(?<month>[0-9]{2})-(?<day>[0-9]{2})~', $date, $matches)) {
+               if (preg_match('~^(?P<year>[0-9]{4})-(?P<month>[0-9]{2})-(?P<day>[0-9]{2})~', $date, $matches)) {
                        if (!checkdate($matches['month'], $matches['day'], $matches['year'])) {
                                throw new SystemException("Date '".$date."' is invalid");
                        }