r85598 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85597‎ | r85598 | r85599 >
Date:00:06, 7 April 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 28176) Review and enable CLDR extension

Guard the PHP file inclusions against path traversal
Modified paths:
  • /trunk/extensions/cldr/LanguageNames.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/cldr/LanguageNames.body.php
@@ -63,7 +63,7 @@
6464
6565 /* Load override for wrong or missing entries in cldr */
6666 $override = dirname(__FILE__) . '/' . self::getOverrideFileName( $code );
67 - if ( file_exists( $override ) ) {
 67+ if ( Language::isValidBuiltInCode( $code ) && file_exists( $override ) ) {
6868 $names = false;
6969 require( $override );
7070 if ( is_array( $names ) ) {
@@ -72,7 +72,7 @@
7373 }
7474
7575 $filename = dirname(__FILE__) . '/' . self::getFileName( $code );
76 - if ( file_exists( $filename ) ) {
 76+ if ( Language::isValidBuiltInCode( $code ) && file_exists( $filename ) ) {
7777 $names = false;
7878 require( $filename );
7979 if ( is_array( $names ) ) {

Status & tagging log