Page MenuHomePhabricator

Exceptions caused by mwTimestamp() are not caught
Closed, ResolvedPublic

Description

Adding (possibly nonsensical) input in URLs for Special:SearchByProperty can cause exceptions. Parameters should be checked and caught in SMW itself, and invalid input should not propagate into core code.

Observed exception:

2012-08-31 16:42:06 v22011026445052.yourvserver.net mediawiki-bw_: [64f709f8] /wiki/Special:SearchByProperty/Modification-20date/29-20April-202011-2000:00:49 Exception from line 109 of /www/translatewiki.net/w/includes/Timestamp.php: MWTimestamp::setTimestamp : Invalid timestamp - 29 April 2011 00:00:49
#0 /www/translatewiki.net/w/includes/Timestamp.php(53): MWTimestamp->setTimestamp('29 April 2011 0...')
#1 /www/translatewiki.net/w/includes/GlobalFunctions.php(2412): MWTimestamp->__construct('29 April 2011 0...')
#2 /www/translatewiki.net/w/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Time.php(149): wfTimestamp(1, '29 April 2011 0...')
#3 /www/translatewiki.net/w/extensions/SemanticMediaWiki/includes/datavalues/SMW_DataValue.php(160): SMWTimeValue->parseUserValue('29 April 2011 0...')
#4 /www/translatewiki.net/w/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php(113): SMWDataValue->setUserValue('29 April 2011 0...', false)
#5 /www/translatewiki.net/w/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php(179): SMWDataValueFactory::newTypeIdValue('_dat', '29 April 2011 0...', false, Object(SMWDIProperty), NULL)
#6 /www/translatewiki.net/w/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php(73): SMWDataValueFactory::newPropertyObjectValue(Object(SMWDIProperty), '29 April 2011 0...')
#7 /www/translatewiki.net/w/includes/SpecialPage.php(611): SMWSearchByProperty->execute('Modification-20...')
#8 /www/translatewiki.net/w/includes/SpecialPageFactory.php(494): SpecialPage->run('Modification-20...')
#9 /www/translatewiki.net/w/includes/Wiki.php(290): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#10 /www/translatewiki.net/w/includes/Wiki.php(536): MediaWiki->performRequest()
#11 /www/translatewiki.net/w/includes/Wiki.php(446): MediaWiki->main()
#12 /www/translatewiki.net/w/index.php(59): MediaWiki->run()


Version: master
Severity: normal
URL: https://translatewiki.net/wiki/Special:SearchByProperty/Modification-20date/29-20April-202011-2000:00:49

Details

Reference
bz39844

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:53 AM
bzimport set Reference to bz39844.

We're seeing these quite often, all kinds of different parameters. I've put a few in an etherpad[1], maybe it helps in analysing the source.

[1] http://etherpad.wikimedia.org/GD0bnahDcM

Which version of MediaWiki have you been using? The problem seems to have been caused by changes in MediaWiki that had accidentally changed the behaviour of wfTimestamp(). However, the current master of MediaWiki catches this exception, so the problem should be gone now. Do you know of any released MW version that had this problem?

(In reply to comment #2)

Which version of MediaWiki have you been using? The problem seems to have been
caused by changes in MediaWiki that had accidentally changed the behaviour of
wfTimestamp(). However, the current master of MediaWiki catches this exception,
so the problem should be gone now. Do you know of any released MW version that
had this problem?

Seems to have worked itself out indeed. Was observed on master, as almost all issues reported from translatewiki.net.

There has not been a release with the faulty behavior, AFAIK.