diff options
Diffstat (limited to 'lib/simplepie/library/SimplePie/Parse/Date.php')
-rw-r--r-- | lib/simplepie/library/SimplePie/Parse/Date.php | 69 |
1 files changed, 61 insertions, 8 deletions
diff --git a/lib/simplepie/library/SimplePie/Parse/Date.php b/lib/simplepie/library/SimplePie/Parse/Date.php index b29274c64..cf57437d2 100644 --- a/lib/simplepie/library/SimplePie/Parse/Date.php +++ b/lib/simplepie/library/SimplePie/Parse/Date.php @@ -5,7 +5,7 @@ * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * - * Copyright (c) 2004-2016, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors + * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -33,9 +33,9 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @copyright 2004-2016 Ryan Parman, Geoffrey Sneddon, Ryan McCue + * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue * @author Ryan Parman - * @author Geoffrey Sneddon + * @author Sam Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License @@ -98,12 +98,20 @@ class SimplePie_Parse_Date 'dimanche' => 7, // German 'montag' => 1, + 'mo' => 1, 'dienstag' => 2, + 'di' => 2, 'mittwoch' => 3, + 'mi' => 3, 'donnerstag' => 4, + 'do' => 4, 'freitag' => 5, + 'fr' => 5, 'samstag' => 6, + 'sa' => 6, 'sonnabend' => 6, + // AFAIK no short form for sonnabend + 'so' => 7, 'sonntag' => 7, // Italian 'lunedì' => 1, @@ -145,6 +153,14 @@ class SimplePie_Parse_Date 'Παρ' => 5, 'Σαβ' => 6, 'Κυρ' => 7, + // Russian + 'Пн.' => 1, + 'Вт.' => 2, + 'Ср.' => 3, + 'Чт.' => 4, + 'Пт.' => 5, + 'Сб.' => 6, + 'Вс.' => 7, ); /** @@ -207,17 +223,28 @@ class SimplePie_Parse_Date 'décembre' => 12, // German 'januar' => 1, + 'jan' => 1, 'februar' => 2, + 'feb' => 2, 'märz' => 3, + 'mär' => 3, 'april' => 4, - 'mai' => 5, + 'apr' => 4, + 'mai' => 5, // no short form for may 'juni' => 6, + 'jun' => 6, 'juli' => 7, + 'jul' => 7, 'august' => 8, + 'aug' => 8, 'september' => 9, + 'sep' => 9, 'oktober' => 10, + 'okt' => 10, 'november' => 11, + 'nov' => 11, 'dezember' => 12, + 'dez' => 12, // Italian 'gennaio' => 1, 'febbraio' => 2, @@ -289,7 +316,33 @@ class SimplePie_Parse_Date 'Σεπ' => 9, 'Οκτ' => 10, 'Νοέ' => 11, - 'Δεκ' => 12, + 'Δεκ' => 12, + // Russian + 'Янв' => 1, + 'января' => 1, + 'Фев' => 2, + 'февраля' => 2, + 'Мар' => 3, + 'марта' => 3, + 'Апр' => 4, + 'апреля' => 4, + 'Май' => 5, + 'мая' => 5, + 'Июн' => 6, + 'июня' => 6, + 'Июл' => 7, + 'июля' => 7, + 'Авг' => 8, + 'августа' => 8, + 'Сен' => 9, + 'сентября' => 9, + 'Окт' => 10, + 'октября' => 10, + 'Ноя' => 11, + 'ноября' => 11, + 'Дек' => 12, + 'декабря' => 12, + ); /** @@ -541,8 +594,8 @@ class SimplePie_Parse_Date */ public function __construct() { - $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')'; - $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')'; + $this->day_pcre = '(' . implode('|', array_keys($this->day)) . ')'; + $this->month_pcre = '(' . implode('|', array_keys($this->month)) . ')'; static $cache; if (!isset($cache[get_class($this)])) @@ -690,7 +743,7 @@ class SimplePie_Parse_Date } // Convert the number of seconds to an integer, taking decimals into account - $second = round((int)$match[6] + (int)$match[7] / pow(10, strlen($match[7]))); + $second = round((int)$match[6] + (int)$match[7] / (10 ** strlen($match[7]))); return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone; } |