dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
7585947
)
Merge "(bug 37587) Enforce language codes to be html safe"
author
Siebrand
<siebrand@wikimedia.org>
Fri, 13 Jul 2012 19:47:33 +0000
(19:47 +0000)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Fri, 13 Jul 2012 19:47:33 +0000
(19:47 +0000)
languages/Language.php
patch
|
blob
|
history
diff --git
a/languages/Language.php
b/languages/Language.php
index
3ee959e
..
430209d
100644
(file)
--- a/
languages/Language.php
+++ b/
languages/Language.php
@@
-246,7
+246,11
@@
class Language {
*/
public static function isValidCode( $code ) {
return
- strcspn( $code, ":/\\\000" ) === strlen( $code )
+ // People think language codes are html safe, so enforce it.
+ // Ideally we should only allow a-zA-Z0-9-
+ // but, .+ and other chars are often used for {{int:}} hacks
+ // see bugs 37564, 37587, 36938
+ strcspn( $code, ":/\\\000&<>'\"" ) === strlen( $code )
&& !preg_match( Title::getTitleInvalidRegex(), $code );
}