Fix notices emitted from DateFormatter
authorTim Starling <tstarling@wikimedia.org>
Wed, 10 Apr 2019 02:50:17 +0000 (12:50 +1000)
committerJforrester <jforrester@wikimedia.org>
Wed, 10 Apr 2019 03:07:12 +0000 (03:07 +0000)
commit2dca358e999c4255a8b3432b520d2316783f5621
tree401f2c3504f17e928082aa729be1c4aaf89a69fb
parentcbd404e7d228f7a6c6a871f58397d783cc9117cb
Fix notices emitted from DateFormatter

Some languages have date abbreviations that contain ".", which allows
the non-ISO regexes to match an input string containing an invalid month
name. Use preg_quote() to avoid this.

Also fix the error handling case of makeIsoMonth(). If the input date is
invalid, don't try to wrap it in a date span, since that's semantically
incorrect and may also access unset members of $bits, causing a notice.

Bug: T220563
Change-Id: Ib2b3fb315dc93b60de595d3c445637f6bcc78a1a
includes/parser/DateFormatter.php