specialpage: Fix login crash caused by unknown language via ?uselang
Per Krinkle's comments here: T198054#
4598447, it's exactly what is
happening. @Fomafix suggests we handle the exception that is been
thrown by Language::factory() when there is an invalid language code
provided. The attempt is to fix this in the central way of ever request
whether POST or GET.
We're working within a particular context, and within this request
context, we can create a language user's language object then generate
a language object. If uselang parameter is provided an invalid language
code, getLanguage in this request context will default to $wgLanguageCode
then use this code to create the user's language object. In addition,
getLanguage() invalidates cached user interface language.
Bug: T198054
Change-Id: I825fdfa882a4243ffc63c9de0d7f482e2cfb9862