dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move interface ILocalizedException to own file
[lhc/web/wiklou.git]
/
includes
/
Html.php
diff --git
a/includes/Html.php
b/includes/Html.php
index
aac492c
..
0aea7ea
100644
(file)
--- a/
includes/Html.php
+++ b/
includes/Html.php
@@
-255,6
+255,12
@@
class Html {
// consistency and better compression.
$element = strtolower( $element );
// consistency and better compression.
$element = strtolower( $element );
+ // Some people were abusing this by passing things like
+ // 'h1 id="foo" to $element, which we don't want.
+ if ( strpos( $element, ' ' ) !== false ) {
+ wfWarn( __METHOD__ . " given element name with space '$element'" );
+ }
+
// Remove invalid input types
if ( $element == 'input' ) {
$validTypes = [
// Remove invalid input types
if ( $element == 'input' ) {
$validTypes = [
@@
-840,9
+846,14
@@
class Html {
// Value is provided by user, the name shown is localized for the user.
$options[$params['all']] = wfMessage( 'namespacesall' )->text();
}
// Value is provided by user, the name shown is localized for the user.
$options[$params['all']] = wfMessage( 'namespacesall' )->text();
}
- // Add all namespaces as options (in the content language)
- $options +=
- MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNamespaces();
+ if ( $params['in-user-lang'] ?? false ) {
+ global $wgLang;
+ $lang = $wgLang;
+ } else {
+ $lang = MediaWikiServices::getInstance()->getContentLanguage();
+ }
+ // Add all namespaces as options
+ $options += $lang->getFormattedNamespaces();
$optionsOut = [];
// Filter out namespaces below 0 and massage labels
$optionsOut = [];
// Filter out namespaces below 0 and massage labels
@@
-855,8
+866,7
@@
class Html {
// main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)")
$nsName = wfMessage( 'blanknamespace' )->text();
} elseif ( is_int( $nsId ) ) {
// main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)")
$nsName = wfMessage( 'blanknamespace' )->text();
} elseif ( is_int( $nsId ) ) {
- $nsName = MediaWikiServices::getInstance()->getContentLanguage()->
- convertNamespace( $nsId );
+ $nsName = $lang->convertNamespace( $nsId );
}
$optionsOut[$nsId] = $nsName;
}
}
$optionsOut[$nsId] = $nsName;
}