diff --git a/src/NodaTimeSplitter.php b/src/NodaTimeSplitter.php index c3b1f98..8eb0d22 100644 --- a/src/NodaTimeSplitter.php +++ b/src/NodaTimeSplitter.php @@ -470,8 +470,8 @@ final class NodaTimeSplitter { $datum = self::clean_input($datum); // 0000-0000 - if (preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]$/", $datum) !== false - || preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]\.$/", $datum) !== false + if (!empty(preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]$/", $datum)) + || !empty(preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]\.$/", $datum)) ) { $start = substr($datum, 0, 4); $end = substr($datum, 5, 4);