Index: branches/resourceloader/phase3/includes/GlobalFunctions.php |
— | — | @@ -1898,7 +1898,7 @@ |
1899 | 1899 | function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) { |
1900 | 1900 | $uts = 0; |
1901 | 1901 | $da = array(); |
1902 | | - if ($ts==0) { |
| 1902 | + if ($ts === 0) { |
1903 | 1903 | $uts=time(); |
1904 | 1904 | } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/D',$ts,$da)) { |
1905 | 1905 | # TS_DB |
— | — | @@ -1919,6 +1919,9 @@ |
1920 | 1920 | # TS_POSTGRES |
1921 | 1921 | } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.*\d* GMT$/',$ts,$da)) { |
1922 | 1922 | # TS_POSTGRES |
| 1923 | + } elseif (preg_match('/^[A-Z][a-z]{2}, \d\d [A-Z][a-z]{2} \d{4} \d\d:\d\d:\d\d/', $ts)) { |
| 1924 | + # TS_RFC2822 |
| 1925 | + $uts = strtotime( $ts ); |
1923 | 1926 | } else { |
1924 | 1927 | # Bogus value; fall back to the epoch... |
1925 | 1928 | wfDebug("wfTimestamp() fed bogus time value: $outputtype; $ts\n"); |