diff -Naur phpldapadmin-1.2.0.5.orig/lib/common.php phpldapadmin-1.2.0.5.new/lib/common.php --- phpldapadmin-1.2.0.5.orig/lib/common.php 2010-01-30 06:21:20.000000000 +0100 +++ phpldapadmin-1.2.0.5.new/lib/common.php 2010-08-27 16:21:51.000000000 +0200 @@ -193,7 +193,7 @@ } # Check for safe mode. -if (ini_get('safe_mode') && ! get_request('cmd','GET')) +if (@ini_get('safe_mode') && ! get_request('cmd','GET')) system_message(array( 'title'=>_('PHP Safe Mode'), 'body'=>_('You have PHP Safe Mode enabled. This application may work unexpectedly in Safe Mode.'), @@ -215,11 +215,11 @@ app_version(),$_REQUEST); # Set our PHP timelimit. -if ($_SESSION[APPCONFIG]->getValue('session','timelimit') && ! ini_get('safe_mode')) +if ($_SESSION[APPCONFIG]->getValue('session','timelimit') && ! @ini_get('safe_mode')) set_time_limit($_SESSION[APPCONFIG]->getValue('session','timelimit')); # If debug mode is set, increase the time_limit, since we probably need it. -if (DEBUG_ENABLED && $_SESSION[APPCONFIG]->getValue('session','timelimit') && ! ini_get('safe_mode')) +if (DEBUG_ENABLED && $_SESSION[APPCONFIG]->getValue('session','timelimit') && ! @ini_get('safe_mode')) set_time_limit($_SESSION[APPCONFIG]->getValue('session','timelimit') * 5); /** @@ -227,7 +227,7 @@ * Shall we attempt to auto-determine the language? */ # If we are in safe mode, and LANG is not in the allowed vars, display an error. -if (ini_get('safe_mode') && ! in_array('LANG',explode(',',ini_get('safe_mode_allowed_env_vars')))) +if (@ini_get('safe_mode') && ! in_array('LANG',explode(',',@ini_get('safe_mode_allowed_env_vars')))) error('You are running in SAFE_MODE, but LANG is not in the safe_mode_allowed_env_vars. Please add LANG to safe_mode_allowed_env_vars','error',true,false); $app['language'] = $_SESSION[APPCONFIG]->getValue('appearance','language'); @@ -296,7 +296,7 @@ * Strip slashes from GET, POST, and COOKIE variables if this * PHP install is configured to automatically addslashes() */ -if (get_magic_quotes_gpc() && (! isset($slashes_stripped) || ! $slashes_stripped)) { +if (@get_magic_quotes_gpc() && (! isset($slashes_stripped) || ! $slashes_stripped)) { array_stripslashes($_REQUEST); array_stripslashes($_GET); array_stripslashes($_POST); diff -Naur phpldapadmin-1.2.0.5.orig/lib/emuhash_functions.php phpldapadmin-1.2.0.5.new/lib/emuhash_functions.php --- phpldapadmin-1.2.0.5.orig/lib/emuhash_functions.php 2010-01-30 06:21:20.000000000 +0100 +++ phpldapadmin-1.2.0.5.new/lib/emuhash_functions.php 2010-08-27 16:14:05.000000000 +0200 @@ -58,8 +58,12 @@ function openssl_hash($openssl_hash_id,$password_clear) { global $emuhash_emu; - $current_magic_quotes = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + if (PHP_VERSION < 6) { + $current_magic_quotes = + @get_magic_quotes_runtime(); + @set_magic_quotes_runtime(0); + } + $tmpfile = tempnam($emuhash_emu['tmpdir'],'emuhash'); $pwhandle = fopen($tmpfile,'w'); @@ -73,7 +77,9 @@ $pass = fread($prog,1024); pclose($prog); unlink($tmpfile); - set_magic_quotes_runtime($current_magic_quotes); + + if (PHP_VERSION < 6) + @set_magic_quotes_runtime($current_magic_quotes); return $pass; }