Last modified: 2011-06-30 18:10:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31471, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29471 - "Non-string key given" - error on Commons file description pages for filenames starting with strings such as JyiaH0fsTk8..
"Non-string key given" - error on Commons file description pages for filename...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Bryan Tong Minh
http://commons.wikimedia.org/w/index....
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-18 10:16 UTC by User:Docu
Modified: 2011-06-30 18:10 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Validate return value of wfTimestamp (857 bytes, patch)
2011-06-18 21:43 UTC, Bryan Tong Minh
Details

Description User:Docu 2011-06-18 10:16:10 UTC
Files in http://commons.wikimedia.org/w/index.php?oldid=55626880 , such as [[Commons:File:JyiaH0fsTk8qygiapsYgBJ6yo1_400.jpg]] display the error message below instead of a file description page. The thumbnail ok though.




Non-string key given

Backtrace:

#0 /usr/local/apache/common-local/php-1.17/includes/GlobalFunctions.php(780): MessageCache->get(NULL, true, Object(Language))
#1 /usr/local/apache/common-local/php-1.17/includes/GlobalFunctions.php(901): wfMsgGetKey(NULL, true, Object(Language), false)
#2 /usr/local/apache/common-local/php-1.17/languages/Language.php(521): wfMsgExt(NULL, Array)
#3 /usr/local/apache/common-local/php-1.17/languages/Language.php(533): Language->getMessageFromDB(NULL)
#4 /usr/local/apache/common-local/php-1.17/languages/Language.php(807): Language->getMonthName(false)
#5 /usr/local/apache/common-local/php-1.17/languages/Language.php(1568): Language->sprintfDate('H:i, Y F j', false)
#6 /usr/local/apache/common-local/php-1.17/includes/Exif.php(740): Language->timeanddate('-00011231000227')
#7 /usr/local/apache/common-local/php-1.17/includes/media/Bitmap.php(591): FormatExif->getFormattedData()
#8 /usr/local/apache/common-local/php-1.17/includes/filerepo/File.php(926): BitmapHandler->formatMetadata(Object(LocalFile), 'a:32:{s:16:"Ima...')
#9 /usr/local/apache/common-local/php-1.17/includes/ImagePage.php(99): File->formatMetadata()
#10 /usr/local/apache/common-local/php-1.17/includes/Wiki.php(469): ImagePage->view()
#11 /usr/local/apache/common-local/php-1.17/includes/Wiki.php(69): MediaWiki->performAction(Object(OutputPage), Object(ImagePage), Object(Title), Object(User), Object(WebRequest))
#12 /usr/local/apache/common-local/php-1.17/index.php(114): MediaWiki->performRequestForTitle(Object(Title), Object(ImagePage), Object(OutputPage), Object(User), Object(WebRequest))
#13 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#14 {main}
Comment 1 Bryan Tong Minh 2011-06-18 10:51:17 UTC
+cc Brian for metadata madness :)
Comment 2 Bawolff (Brian Wolff) 2011-06-18 20:21:12 UTC
Basic issue is MediaWiki doesn't like the years before Jesus is born.

What is happening:
*File is listed as being created on 0000:01:00 00:02:27 - which is really malformed, because in exif date format, days start at 01, not 00. So mediawiki interprets that as the -1'th of January, aka the 31st of December: -0001:12:31 00:02:27
*Converted to mediawiki ts format, that's -00011231000227
*Converted to MediaWiki ts format again, wfTimestamp seems not to like negative dates in MW format. Returns false.
*Language::sprintfDate barfs on false
Comment 3 Bryan Tong Minh 2011-06-18 21:37:36 UTC
So, two issues if I understand correctly:
* We don't validate EXIF dates
* We don't handle BC dates
Comment 4 Bryan Tong Minh 2011-06-18 21:43:36 UTC
Created attachment 8682 [details]
Validate return value of wfTimestamp

Patch which should fix this issue in 1.19.

I suggest to add a test case to phpunit before this is committed.
Comment 5 Bawolff (Brian Wolff) 2011-06-19 00:16:32 UTC
yep, that works.

I tried experimenting with adding support to BC dates to Language::timeanddate and friends, but it starts to get messy with lots of assumptions about the parts of the date correspond to specific character positions in the string, so just checking the dates are positive years is probably good enough.
Comment 6 Bryan Tong Minh 2011-06-19 21:40:01 UTC
r90421
Comment 7 Mark A. Hershberger 2011-06-21 22:18:13 UTC
reopening while that revision is marked FIXME
Comment 8 Bryan Tong Minh 2011-06-30 18:10:08 UTC
Fixed now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links