Have timeanddate() change timestamp-looking timestampts to YYYYMMDDHH24MISS integer...
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Mon, 19 Mar 2007 13:43:42 +0000 (13:43 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Mon, 19 Mar 2007 13:43:42 +0000 (13:43 +0000)
Fixes bug 8558 (Special:Imagelist) as well as other pages (i.e. Special:Unusedimages)

RELEASE-NOTES
languages/Language.php

index 2dc72e5..586a549 100644 (file)
@@ -276,6 +276,7 @@ lighter making things easier to read.
   image
 * (bug 8582) Allow thumbnailing when imagesize has a space.
 * (bug 8716) Change math_inputhash and math_outputhash to byte for Postgres
+* (bug 8558) Correct display of timestamps on some pages when using Postgres
 
 Support protocols other than HTTP in LinkFilter
 
index a23c304..db24767 100644 (file)
@@ -753,6 +753,12 @@ class Language {
        */
        function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) {
                $this->load();
+
+               ## Account for non-integer timestamps
+               if (substr($ts,4,1) === '-') {
+                       $ts = preg_replace('/\D/', '', $ts);
+               }
+
                if ( $adj ) { 
                        $ts = $this->userAdjust( $ts, $timecorrection ); 
                }