Last modified: 2014-03-31 19:13:19 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 T64849, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62849 - ResourceLoader: Internal error when calling with load.php with invalid uselang
ResourceLoader: Internal error when calling with load.php with invalid uselang
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
unspecified
All All
: Normal trivial (vote)
: 1.23.0 release
Assigned To: Krinkle
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2014-03-19 21:26 UTC by Krinkle
Modified: 2014-03-31 19:13 UTC (History)
4 users (show)

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


Attachments

Description Krinkle 2014-03-19 21:26:31 UTC
Not a high priority since this is only relevant to requests that are invalid and are never formed by MediaWiki itself, but an ugly way to handle the error.

When accessing index.php with an invalid uselang, it gets sanitised to 'en' by Wiki.php -> RequestContext.php#sanitizeLangCode.

On the load.php path, it results in an MWException from Language::newFromCode

exception 'MWException' with message 'Invalid language code "x:' in mediawiki/languages/Language.php:217
Stack trace:
#0 mediawiki/languages/Language.php(196): Language::newFromCode('x:')
#1 mediawiki/includes/resourceloader/ResourceLoaderContext.php(162): Language::factory('x:')
#2 mediawiki/includes/resourceloader/ResourceLoaderContext.php(237): ResourceLoaderContext->getDirection()
#3 mediawiki/includes/resourceloader/ResourceLoaderWikiModule.php(224): ResourceLoaderContext->getHash()
#4 mediawiki/includes/resourceloader/ResourceLoaderWikiModule.php(179): ResourceLoaderWikiModule->getTitleMtimes(Object(ResourceLoaderContext))
#5 mediawiki/includes/resourceloader/ResourceLoader.php(514): ResourceLoaderWikiModule->getModifiedTime(Object(ResourceLoaderContext))
#6 mediawiki/load.php(43): ResourceLoader->respond(Object(ResourceLoaderContext))
#7 {main}



ResourceLoader::makeModuleResponse: generating module package failed: exception 'MWException' with message 'Invalid language code "x:"' in /usr/local/apache/common-local/php-1.23wmf17/languages/Language.php:217
Stack trace:
#0 /usr/local/apache/common-local/php-1.23wmf17/languages/Language.php(196): Language::newFromCode('x:')
#1 /usr/local/apache/common-local/php-1.23wmf17/includes/resourceloader/ResourceLoaderContext.php(162): Language::factory('x:')
#2 /usr/local/apache/common-local/php-1.23wmf17/includes/resourceloader/ResourceLoaderModule.php(118): ResourceLoaderContext->getDirection()
#3 /usr/local/apache/common-local/php-1.23wmf17/includes/resourceloader/ResourceLoaderWikiModule.php(158): ResourceLoaderModule->getFlip(Object(ResourceLoaderContext))
#4 /usr/local/apache/common-local/php-1.23wmf17/includes/resourceloader/ResourceLoader.php(778): ResourceLoaderWikiModule->getStyles(Object(ResourceLoaderContext))
#5 /usr/local/apache/common-local/php-1.23wmf17/includes/resourceloader/ResourceLoader.php(518): ResourceLoader->makeModuleResponse(Object(ResourceLoaderContext), Array, Array)
#6 /usr/local/apache/common-local/php-1.23wmf17/load.php(43): ResourceLoader->respond(Object(ResourceLoaderContext))
#7 /usr/local/apache/common-local/w/load.php(3): require('/usr/local/apac...')
#8 {main}
Comment 1 Gerrit Notification Bot 2014-03-19 21:41:24 UTC
Change 119644 had a related patch set uploaded by Krinkle:
resourceloader: Sanitize lang code before creating Language object

https://gerrit.wikimedia.org/r/119644
Comment 2 Gerrit Notification Bot 2014-03-26 22:31:11 UTC
Change 119644 merged by jenkins-bot:
resourceloader: Sanitize lang code before creating Language object

https://gerrit.wikimedia.org/r/119644
Comment 3 db [inactive,noenotif] 2014-03-31 19:00:36 UTC
(In reply to Gerrit Notification Bot from comment #2)
> Change 119644 merged by jenkins-bot:
resourceloader: Sanitize lang code
> before creating Language object

https://gerrit.wikimedia.org/r/119644

Status Merged

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


Navigation
Links