Last modified: 2014-03-31 19:13:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
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