r11947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11946‎ | r11947 | r11948 >
Date:11:09, 4 December 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 4165) Correct validation for user language selection (data taint)
Modified paths:
  • /branches/REL1_5/phase3/includes/Setup.php (modified) (history)

Diff [purge]

Index: branches/REL1_5/phase3/includes/Setup.php
@@ -217,7 +217,7 @@
218218 if ($wgLanguageCode == '')
219219 $wgLanguageCode = $wgUser->getOption('language');
220220 # Validate $wgLanguageCode, which will soon be sent to an eval()
221 -if( empty( $wgLanguageCode ) || preg_match( '/^[^a-z-]*$/', $wgLanguageCode ) ) {
 221+if( empty( $wgLanguageCode ) || !preg_match( '/^[a-z]+(-[a-z]+)?$/', $wgLanguageCode ) ) {
222222 $wgLanguageCode = $wgContLanguageCode;
223223 }
224224

Follow-up revisions

RevisionCommit summaryAuthorDate
r11948* (bug 4165) Correct validation for user language selection (data taint)vibber11:14, 4 December 2005

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r11946* (bug 4165) Correct validation for user language selection (data taint)vibber10:53, 4 December 2005

Status & tagging log