r64164 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64163‎ | r64164 | r64165 >
Date:18:17, 25 March 2010
Author:maxsem
Status:ok
Tags:
Comment:
new-installer: escape $wgSQLiteDataDir
Modified paths:
  • /branches/new-installer/phase3/includes/installer/LocalSettings.php (modified) (history)
  • /branches/new-installer/phase3/includes/installer/SqliteInstaller.php (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/includes/installer/LocalSettings.php
@@ -34,10 +34,10 @@
3535 $this->dbSettings = $db->getLocalSettings();
3636 $this->safeMode = $installer->getVar( '_SafeMode' );
3737 $this->values['wgEmergencyContact'] = $this->values['wgPasswordSender'];
38 - $this->values = wfArrayMap( array( $this, 'escapePhpString' ), $this->values );
 38+ $this->values = wfArrayMap( array( 'LocalSettings', 'escapePhpString' ), $this->values );
3939 }
4040
41 - function escapePhpString( $string ) {
 41+ public static function escapePhpString( $string ) {
4242 if ( is_array( $string ) || is_object( $string ) ) {
4343 return false;
4444 }
@@ -111,9 +111,9 @@
112112 }
113113 $mcservers = $this->buildMemcachedServerList();
114114 return "<?php
115 -# This file was automatically generated by the MediaWiki installer.
116 -# If you make manual changes, please keep track in case you need to
117 -# recreate them later.
 115+# This file was automatically generated by the MediaWiki {$GLOBALS['wgVersion']}
 116+# installer. If you make manual changes, please keep track in case you
 117+# need to recreate them later.
118118 #
119119 # See includes/DefaultSettings.php for all configurable settings
120120 # and their default values, but don't forget to make changes in _this_
Index: branches/new-installer/phase3/includes/installer/SqliteInstaller.php
@@ -125,7 +125,7 @@
126126 }
127127
128128 function getLocalSettings() {
129 - $dir = $this->getVar( 'wgSQLiteDataDir' );
 129+ $dir = LocalSettings::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
130130 return
131131 "# SQLite-specific settings
132132 \$wgSQLiteDataDir = \"{$dir}\";";

Status & tagging log