Author: overlordq
Description:
YATB (Yet Another Timestamp Bug).
Trying to revert an image results in this error:
A database error has occurred Query: SELECT oi_size,oi_width,oi_height,oi_bits,oi_media_type,oi_major_mime,oi_minor_mime,oi_metadata,oi_timestamp,oi_sha1,oi_user,oi_user_text,oi_description,oi_archive_name,oi_deleted FROM oldimage WHERE oi_name = 'Smiley.svg' AND (oi_timestamp <= '20080327074730!Smiley.svg') ORDER BY oi_timestamp DESC LIMIT 1 Function: OldLocalFile::loadFromDB Error: 1 ERROR: invalid input syntax for type timestamp with time zone: "20080327074730!Smiley.svg"
Backtrace:
#0 /home/wiki/includes/Database.php(799): DatabasePostgres->reportQueryError('ERROR: invalid...', 1, 'SELECT oi_size...', 'OldLocalFile::l...', false)
#1 /home/wiki/includes/Database.php(1244): Database->query('SELECT oi_size...', 'OldLocalFile::l...')
#2 /home/wiki/includes/Database.php(1263): Database->select('oldimage', Array, Array, 'OldLocalFile::l...', Array)
#3 /home/wiki/includes/filerepo/OldLocalFile.php(174): Database->selectRow('oldimage', Array, Array, 'OldLocalFile::l...', Array)
#4 /home/wiki/includes/filerepo/LocalFile.php(248): OldLocalFile->loadFromDB()
#5 /home/wiki/includes/filerepo/LocalFile.php(450): LocalFile->load()
#6 /home/wiki/includes/filerepo/FileRepo.php(91): LocalFile->exists()
#7 /home/wiki/includes/filerepo/RepoGroup.php(66): FileRepo->findFile(Object(Title), '20080327074730!...')
#8 /home/wiki/includes/GlobalFunctions.php(2346): RepoGroup->findFile(Object(Title), '20080327074730!...')
#9 /home/wiki/includes/FileRevertForm.php(137): wfFindFile(Object(Title), '20080327074730!...')
#10 /home/wiki/includes/FileRevertForm.php(58): FileRevertForm->haveOldVersion()
#11 /home/wiki/includes/ImagePage.php(502): FileRevertForm->execute()
#12 /home/wiki/includes/Wiki.php(447): ImagePage->revert()
#13 /home/wiki/includes/Wiki.php(59): MediaWiki->performAction(Object(OutputPage), Object(ImagePage), Object(Title), Object(User), Object(WebRequest))
#14 /home/wiki/index.php(92): MediaWiki->initialize(Object(Title), Object(ImagePage), Object(OutputPage), Object(User), Object(WebRequest))
#15 {main}
20080327074730!Smiley.svg (oi_archive_name) is most definitely not a valid timestamp.
Version: 1.13.x
Severity: major