From 8c5f5ba6295d7f46412dfeb0c65ffcd264997559 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 17 Sep 2010 10:33:58 +0000 Subject: [PATCH] - check for magic_quotes_runtime in installation and init-script (for updaters) because of strange behavior of Froxlor if enabled (deactivating it temporarily if so, but better fix php.ini) --- install/install.php | 12 ++++++++++++ install/lng/english.lng.php | 7 +++++++ install/lng/german.lng.php | 7 +++++++ lib/init.php | 9 +++++++++ 4 files changed, 35 insertions(+) diff --git a/install/install.php b/install/install.php index da564078..3d8dc853 100644 --- a/install/install.php +++ b/install/install.php @@ -182,6 +182,18 @@ function requirement_checks() status_message('green', 'OK'); } + // Check if magic_quotes_runtime is active + status_message('begin', $lng['install']['phpmagic_quotes_runtime']); + if(get_magic_quotes_runtime()) + { + // Deactivate + set_magic_quotes_runtime(false); + status_message('orange', $lng['install']['active'] . '
' . $lng['install']['phpmagic_quotes_runtime_description']); + } + else + { + status_message('green', 'OK'); + } status_message('begin', $lng['install']['phpmysql']); diff --git a/install/lng/english.lng.php b/install/lng/english.lng.php index e8e546c2..960816c3 100644 --- a/install/lng/english.lng.php +++ b/install/lng/english.lng.php @@ -91,4 +91,11 @@ $lng['install']['click_here_to_refresh'] = 'Re-check'; $lng['install']['click_here_to_continue'] = 'Continue installation'; $lng['install']['froxlor_succ_checks'] = 'All requirements are satisfied'; +/* + * Added in Froxlor 0.9.13 + */ +$lng['install']['phpmagic_quotes_runtime'] = 'Checking whether magic_quotes_runtime is off'; +$lng['install']['active'] = 'no'; +$lng['install']['phpmagic_quotes_runtime_description'] = 'PHP setting "magic_quotes_runtime" must be set to "Off" in order to avoid strange behavior of Froxlor. Disabling it for now (this is only temporary, please fix our php.ini).'; + ?> diff --git a/install/lng/german.lng.php b/install/lng/german.lng.php index 986e331d..9f4f91d0 100644 --- a/install/lng/german.lng.php +++ b/install/lng/german.lng.php @@ -91,4 +91,11 @@ $lng['install']['click_here_to_refresh'] = 'Erneut prüfen'; $lng['install']['click_here_to_continue'] = 'Installation fortführen'; $lng['install']['froxlor_succ_checks'] = 'Alle Vorraussetzungen sind erfüllt'; +/* + * Added in Froxlor 0.9.13 + */ +$lng['install']['phpmagic_quotes_runtime'] = 'Prüfe ob magic_quotes_runtime ausgeschalten ist'; +$lng['install']['active'] = 'nein'; +$lng['install']['phpmagic_quotes_runtime_description'] = 'Die PHP Einstellung "magic_quotes_runtime" muss deaktiviert sein ("Off"), um merkwürdige Verhalten von Froxlor zu umgehen. Sie wurde deaktiviert (nur temporär, bitte php.ini anpassen).'; + ?> diff --git a/lib/init.php b/lib/init.php index 28b4f0bd..d29ed087 100644 --- a/lib/init.php +++ b/lib/init.php @@ -120,6 +120,15 @@ if(!isset($need_root_db_sql_data) || $need_root_db_sql_data !== true) $idna_convert = new idna_convert_wrapper(); +/** + * disable magic_quotes_runtime if enabled + */ +if(get_magic_quotes_runtime()) +{ + //Deactivate + set_magic_quotes_runtime(false); +} + /** * Reverse magic_quotes_gpc=on to have clean GPC data again */