From 55f1bc4d383609427149346db0cfbb3728b343f5 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 1 Aug 2008 19:15:01 +0000 Subject: [PATCH] bug #2032707 [core] PMA does not start if ini_set() is disabled --- ChangeLog | 1 + export.php | 2 +- libraries/session.inc.php | 22 +++++++++++----------- phpmyadmin.css.php | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2350087de..968db1537 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA 2.11.9.0 (not yet released) - bug #2031221 [auth] Links to version number on login screen +- bug #2032707 [core] PMA does not start if ini_set() is disabled 2.11.8.0 (2008-07-28) - patch #1987593 [interface] Table list pagination in navi, diff --git a/export.php b/export.php index bdfb34275..1d22a3028 100644 --- a/export.php +++ b/export.php @@ -344,7 +344,7 @@ if (!$save_on_server) { // Download // (avoid rewriting data containing HTML with anchors and forms; // this was reported to happen under Plesk) - ini_set('url_rewriter.tags',''); + @ini_set('url_rewriter.tags',''); if (!empty($content_encoding)) { header('Content-Encoding: ' . $content_encoding); diff --git a/libraries/session.inc.php b/libraries/session.inc.php index bcc8993e0..c5121a005 100644 --- a/libraries/session.inc.php +++ b/libraries/session.inc.php @@ -35,26 +35,26 @@ if (!@function_exists('session_name')) { session_set_cookie_params(0, PMA_Config::getCookiePath() . '; HttpOnly', '', PMA_Config::isHttps()); -// cookies are safer -ini_set('session.use_cookies', true); +// cookies are safer (use @ini_set() in case this function is disabled) +@ini_set('session.use_cookies', true); // but not all user allow cookies -ini_set('session.use_only_cookies', false); -ini_set('session.use_trans_sid', true); -ini_set('url_rewriter.tags', +@ini_set('session.use_only_cookies', false); +@ini_set('session.use_trans_sid', true); +@ini_set('url_rewriter.tags', 'a=href,frame=src,input=src,form=fakeentry,fieldset='); //ini_set('arg_separator.output', '&'); // delete session/cookies when browser is closed -ini_set('session.cookie_lifetime', 0); +@ini_set('session.cookie_lifetime', 0); // warn but dont work with bug -ini_set('session.bug_compat_42', false); -ini_set('session.bug_compat_warn', true); +@ini_set('session.bug_compat_42', false); +@ini_set('session.bug_compat_warn', true); // use more secure session ids (with PHP 5) if (version_compare(PHP_VERSION, '5.0.0', 'ge')) { - ini_set('session.hash_function', 1); + @ini_set('session.hash_function', 1); } // some pages (e.g. stylesheet) may be cached on clients, but not in shared @@ -83,9 +83,9 @@ if (! isset($_COOKIE[$session_name])) { ob_start(); $old_display_errors = ini_get('display_errors'); $old_error_reporting = error_reporting(E_ALL); - ini_set('display_errors', 1); + @ini_set('display_errors', 1); $r = session_start(); - ini_set('display_errors', $old_display_errors); + @ini_set('display_errors', $old_display_errors); error_reporting($old_error_reporting); unset($old_display_errors, $old_error_reporting); $session_error = ob_get_contents(); diff --git a/phpmyadmin.css.php b/phpmyadmin.css.php index 3aee8092d..f854b61d2 100644 --- a/phpmyadmin.css.php +++ b/phpmyadmin.css.php @@ -19,7 +19,7 @@ require_once './libraries/sqlparser.lib.php'; // when zlib_compression is on if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER == '6' && (ini_get('zlib.output_compression'))) { - ini_set('zlib.output_compression', 'Off'); + @ini_set('zlib.output_compression', 'Off'); } if ($GLOBALS['text_dir'] === 'ltr') {