From fd80bf5b38bf1cab65aba129bc4070e57ad6f86d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 29 May 2005 10:20:21 +0000 Subject: [PATCH] * (bug 2234) allow special chars in database passwords during install --- RELEASE-NOTES | 2 ++ install-utils.inc | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a4a26eb747..151908cef3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/install-utils.inc b/install-utils.inc index 1cd85605c2..913dae531e 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -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; } -- 2.20.1