* (bug 2234) allow special chars in database passwords during install
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 29 May 2005 10:20:21 +0000 (10:20 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 29 May 2005 10:20:21 +0000 (10:20 +0000)
RELEASE-NOTES
install-utils.inc

index a4a26eb..151908c 100644 (file)
@@ -219,6 +219,8 @@ Various bugfixes, small features, and a few experimental things:
 * Add validate table and val_ip column through the updater.
 * Simple rate limiter for edits and page moves; set $wgRateLimits
   (somewhat experimental; currently needs memcached)
+* (bug 2234) allow special chars in database passwords during install
+
 
 === Caveats ===
 
index 1cd8560..913dae5 100644 (file)
@@ -76,10 +76,12 @@ function replacevars( $ins ) {
        );
 
        foreach ( $varnames as $var ) {
-               global $$var;
-               $ins = str_replace( '{$' . $var . '}', $$var, $ins );
-               $ins = str_replace( '/*$' . $var . '*/`', '`' . $$var, $ins );
-               $ins = str_replace( '/*$' . $var . '*/', $$var, $ins );
+               if( isset( $GLOBALS[$var] ) ) {
+                       $val = addslashes( $GLOBALS[$var] );
+                       $ins = str_replace( '{$' . $var . '}', $val, $ins );
+                       $ins = str_replace( '/*$' . $var . '*/`', '`' . $val, $ins );
+                       $ins = str_replace( '/*$' . $var . '*/', $val, $ins );
+               }
        }
        return $ins;
 }