diff -Naur WebCalendar-1.2.4.orig/includes/classes/phpmailer/class.phpmailer.php WebCalendar-1.2.4.new/includes/classes/phpmailer/class.phpmailer.php --- WebCalendar-1.2.4.orig/includes/classes/phpmailer/class.phpmailer.php 2007-08-06 04:28:33.000000000 +0200 +++ WebCalendar-1.2.4.new/includes/classes/phpmailer/class.phpmailer.php 2011-09-30 16:30:10.006341799 +0200 @@ -1087,12 +1087,18 @@ $this->SetError($this->Lang("file_open") . $path); return ""; } - $magic_quotes = get_magic_quotes_runtime (); - set_magic_quotes_runtime(0); + + if (function_exists('set_magic_quotes_runtime')) { + $magic_quotes = @get_magic_quotes_runtime(); + @set_magic_quotes_runtime(0); + } + $file_buffer = fread($fd, filesize($path)); $file_buffer = $this->EncodeString($file_buffer, $encoding); fclose($fd); - set_magic_quotes_runtime($magic_quotes); + + if (isset($magic_quotes)) + @set_magic_quotes_runtime($magic_quotes); return $file_buffer; } diff -Naur WebCalendar-1.2.4.orig/includes/translate.php WebCalendar-1.2.4.new/includes/translate.php --- WebCalendar-1.2.4.orig/includes/translate.php 2011-08-07 19:56:15.000000000 +0200 +++ WebCalendar-1.2.4.new/includes/translate.php 2011-09-30 16:30:10.020340757 +0200 @@ -67,7 +67,8 @@ if ( strlen ( $buffer ) == 0 ) continue; - if ( get_magic_quotes_runtime () && $strip ) + if (function_exists('get_magic_quotes_runtime') && + @get_magic_quotes_runtime() && $strip) $buffer = stripslashes ( $buffer ); // Convert quotes to entities. diff -Naur WebCalendar-1.2.4.orig/includes/user-app-postnuke.php WebCalendar-1.2.4.new/includes/user-app-postnuke.php --- WebCalendar-1.2.4.orig/includes/user-app-postnuke.php 2011-08-07 19:56:15.000000000 +0200 +++ WebCalendar-1.2.4.new/includes/user-app-postnuke.php 2011-09-30 16:30:10.020340758 +0200 @@ -490,4 +490,4 @@ global $error; $error = 'User admin not supported.'; return false; } -?> \ No newline at end of file +?> diff -Naur WebCalendar-1.2.4.orig/install/index.php WebCalendar-1.2.4.new/install/index.php --- WebCalendar-1.2.4.orig/install/index.php 2011-08-09 05:12:43.000000000 +0200 +++ WebCalendar-1.2.4.new/install/index.php 2011-09-30 16:30:10.022340608 +0200 @@ -109,8 +109,13 @@ // First pass at settings.php. // We need to read it first in order to get the md5 password. -$magic = @get_magic_quotes_runtime (); -@set_magic_quotes_runtime (0); +if (function_exists('set_magic_quotes_runtime')) { + $magic = @get_magic_quotes_runtime(); + @set_magic_quotes_runtime(0); + } +else + unset($magic); + $fd = @fopen ( $file, 'rb', true ); $settings = array (); $password = ''; @@ -132,7 +137,9 @@ $forcePassword = true; } } -@set_magic_quotes_runtime ($magic); + +if (isset($magic)) + @set_magic_quotes_runtime($magic); session_start (); $doLogin = false; @@ -251,8 +258,13 @@ exit; } -$magic = @get_magic_quotes_runtime (); -@set_magic_quotes_runtime (0); +if (function_exists('set_magic_quotes_runtime')) { + $magic = @get_magic_quotes_runtime(); + @set_magic_quotes_runtime(0); + } +else + unset($magic); + $fd = @fopen ( $file, 'rb', false ); if ( ! empty ( $fd ) ) { while ( ! feof ( $fd ) ) { @@ -270,7 +282,9 @@ } fclose ( $fd ); } -@set_magic_quotes_runtime ($magic); + +if (isset($magic)) + @set_magic_quotes_runtime($magic); $action = getGetValue ( 'action' ); // We were set here because of a mismatch of $PROGRAM_VERSION diff -Naur WebCalendar-1.2.4.orig/install/install_functions.php WebCalendar-1.2.4.new/install/install_functions.php --- WebCalendar-1.2.4.orig/install/install_functions.php 2007-08-06 04:28:33.000000000 +0200 +++ WebCalendar-1.2.4.new/install/install_functions.php 2011-09-30 16:30:10.022340608 +0200 @@ -454,8 +454,12 @@ $current_pointer = false; $full_sql = ''; - $magic = @get_magic_quotes_runtime (); - @set_magic_quotes_runtime ( 0 ); + + if (function_exists('set_magic_quotes_runtime')) { + $magic = @get_magic_quotes_runtime(); + @set_magic_quotes_runtime(0); + } + $fd = @fopen ( 'sql/' . $install_filename, 'r', true ); // Discard everything up to the required point in the upgrade file. @@ -483,7 +487,9 @@ $full_sql .= $data; } - @set_magic_quotes_runtime ( $magic ); + if (isset($magic)) + @set_magic_quotes_runtime($magic); + fclose ( $fd ); $parsed_sql = parse_sql ( $full_sql ); diff -Naur WebCalendar-1.2.4.orig/register.php WebCalendar-1.2.4.new/register.php --- WebCalendar-1.2.4.orig/register.php 2011-08-07 19:56:14.000000000 +0200 +++ WebCalendar-1.2.4.new/register.php 2011-09-30 16:30:10.040339271 +0200 @@ -28,7 +28,7 @@ $WebCalendar->setLanguage (); require ( 'includes/classes/WebCalMailer.class' ); -$mail = &new WebCalMailer; +$mail = new WebCalMailer; $appStr = generate_application_name (); diff -Naur WebCalendar-1.2.4.orig/usersel.php WebCalendar-1.2.4.new/usersel.php --- WebCalendar-1.2.4.orig/usersel.php 2008-10-15 05:05:11.000000000 +0200 +++ WebCalendar-1.2.4.new/usersel.php 2011-09-30 16:30:10.069337116 +0200 @@ -21,7 +21,7 @@ } // Parse $users. -$exp = split ( ',', $users ); +$exp = explode(',', $users); $groups = $selected = $sql_params = array (); for ( $i = 0, $cnt = count ( $exp ); $i < $cnt; $i++ ) { $selected[$exp[$i]] = 1;