From d4e98fcfbd3653086171648ac0ab6019b71d5837 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 19 Nov 2008 09:49:22 +0000 Subject: [PATCH] MDL-17274 security: register globals not supported- now we are preventing upgrades and installs too; backported from HEAD --- install.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/install.php b/install.php index e8ae2a99375..35e07537cef 100644 --- a/install.php +++ b/install.php @@ -772,6 +772,8 @@ function print_object($object) { function form_table($nextstage = WELCOME, $formaction = "install.php") { global $INSTALL, $db; + $enablenext = true; + /// Print the standard form if we aren't in the DOWNLOADLANG page /// because it has its own form. if ($nextstage != DOWNLOADLANG) { @@ -806,12 +808,16 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") { /// Check that PHP is of a sufficient version print_compatibility_row(inst_check_php_version(), get_string('phpversion', 'install'), get_string('phpversionerror', 'install'), 'phpversionhelp'); + $enablenext = $enablenext && inst_check_php_version(); /// Check session auto start print_compatibility_row(!ini_get_bool('session.auto_start'), get_string('sessionautostart', 'install'), get_string('sessionautostarterror', 'install'), 'sessionautostarthelp'); + $enablenext = $enablenext && !ini_get_bool('session.auto_start'); /// Check magic quotes print_compatibility_row(!ini_get_bool('magic_quotes_runtime'), get_string('magicquotesruntime', 'install'), get_string('magicquotesruntimeerror', 'install'), 'magicquotesruntimehelp'); + $enablenext = $enablenext && !ini_get_bool('magic_quotes_runtime'); /// Check unsupported PHP configuration - print_compatibility_row(ini_get_bool('magic_quotes_gpc') || (!ini_get_bool('register_globals')), get_string('globalsquotes', 'install'), get_string('globalsquoteserror', 'install'), 'globalsquoteshelp'); + print_compatibility_row(!ini_get_bool('register_globals'), get_string('globalsquotes', 'install'), get_string('globalswarning', 'install')); + $enablenext = $enablenext && !ini_get_bool('register_globals'); /// Check safe mode print_compatibility_row(!ini_get_bool('safe_mode'), get_string('safemode', 'install'), get_string('safemodeerror', 'install'), 'safemodehelp', true); /// Check file uploads @@ -990,9 +996,11 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") { - \n" : " \n" ?> + \n" : " \n" ?> WELCOME) ? "\n" : " \n" ?> \n"; echo ""; echo "

$errormessage "; - install_helpbutton("install.php?help=$helpfield"); + if ($helpfield !== '') { + install_helpbutton("install.php?help=$helpfield"); + } echo "

\n"; } echo "\n";