Index: check_requirements.php
=================================================================== 
--- check_requirements.php	2010-04-06 15:16:56.000000000 +0400
+++ check_requirements.php	2010-04-08 12:30:20.000000000 +0400
@@ -182,10 +182,10 @@
 	"critical"=>0);
 
 $CHECK_REQUIREMENTS["req_vars"][] = array (
-	"option"  =>"magic_quotes_gpc",
-	"req_val" =>1,
+	"option"  =>"sql.safe_mode",
+	"req_val" =>0,
 	"real_val"=>"",
-	"critical"=>0);
+	"critical"=>1);
 
 $CHECK_REQUIREMENTS["req_vars"][] = array (
 	"option"  =>"magic_quotes_runtime",
Index: include/func/func.compat.php
=================================================================== 
--- include/func/func.compat.php	2010-04-06 15:16:55.000000000 +0400
+++ include/func/func.compat.php	2010-04-08 12:30:20.000000000 +0400
@@ -155,4 +155,14 @@
 	return $val;
 }
 }
+
+if (!function_exists("func_parse_ini")) {
+function func_parse_ini($file) {
+	if (defined('X_PHP530_COMPAT')) {
+		return parse_ini_file($file, true, INI_SCANNER_RAW);
+	}
+
+	return parse_ini_file($file, true);	
+}
+}
 ?>
Index: include/func/func.mail.php
=================================================================== 
--- include/func/func.mail.php	2010-04-06 15:16:55.000000000 +0400
+++ include/func/func.mail.php	2010-04-08 12:30:20.000000000 +0400
@@ -306,7 +306,7 @@
 	if (trim($mail_from) != "")
 		$headers .= "Reply-to: ".$mail_from.$lend;
 
-	if ($config['Email']['use_smtp'] == 'Y') {
+	if ($config['Email']['use_smtp'] == 'Y' && function_exists("set_magic_quotes_runtime")) {
 		$mail_data = array (
 			"to" => $to,
 			"lend" => $lend,
Index: init.php
=================================================================== 
--- init.php	2010-04-06 15:16:56.000000000 +0400
+++ init.php	2010-04-08 12:30:20.000000000 +0400
@@ -53,6 +53,13 @@
 
 unset($zlib_oc);
 
+if (func_version_compare(phpversion(), "5.3.0") >= 0) {
+	define('X_PHP530_COMPAT', true);
+}
+
+if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set'))
+	@date_default_timezone_set(@date_default_timezone_get());
+
 if (!@is_readable($xcart_dir."/config.php")) {
 	func_show_error_page("Cannot read config!");
 }
@@ -225,6 +232,9 @@
 #
 # Redefine error_reporting option
 #
+if (defined('X_PHP530_COMPAT'))
+	$x_error_reporting = $x_error_reporting ^ (E_DEPRECATED | E_USER_DEPRECATED);
+
 error_reporting ($x_error_reporting);
 
 #
Index: include/install.php
=================================================================== 
--- include/install.php	2010-04-06 15:16:56.000000000 +0400
+++ include/install.php	2010-04-08 12:30:20.000000000 +0400
@@ -49,7 +49,9 @@
 #
 if (defined('AREA_TYPE')) return; # for internal use
 
-set_magic_quotes_runtime(0);
+if (function_exists('set_magic_quotes_runtime'))
+	@set_magic_quotes_runtime(0);
+
 error_reporting (E_ALL ^ E_NOTICE);
 @set_time_limit(300);
 umask(0);
@@ -58,7 +60,10 @@
 #
 $sql_reconnect_count = 100;
 
-$__quotes_qpc = get_magic_quotes_gpc();
+$__quotes_qpc = function_exists('get_magic_quotes_gpc') ? get_magic_quotes_gpc() : false;
+
+if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set'))
+	@date_default_timezone_set(@date_default_timezone_get());
 
 function mystripslashes($var) {
 	if (!is_array($var)) return stripslashes($var);
Index: prepare.php
=================================================================== 
--- prepare.php	2010-04-06 15:16:56.000000000 +0400
+++ prepare.php	2010-04-08 12:30:20.000000000 +0400
@@ -49,7 +49,9 @@
 #
 #
 
-set_magic_quotes_runtime(0);
+if (function_exists('set_magic_quotes_runtime'))
+	@set_magic_quotes_runtime(0);
+
 ini_set("magic_quotes_sybase",0);
 ini_set("session.bug_compat_42",1);
 ini_set("session.bug_compat_warn",0);
@@ -109,7 +111,7 @@
 	unset($init, $ids, $result);
 }
 
-$__quotes_qpc = get_magic_quotes_gpc();
+$__quotes_qpc = function_exists('get_magic_quotes_gpc') ? get_magic_quotes_gpc() : false;
 
 function func_microtime() {
 	list($usec, $sec) = explode(" ", microtime()); 
Index: modules/Image_Verification/spambot_requirements.php
=================================================================== 
--- modules/Image_Verification/spambot_requirements.php	2010-04-06 15:16:54.000000000 +0400
+++ modules/Image_Verification/spambot_requirements.php	2010-04-08 12:30:20.000000000 +0400
@@ -43,6 +43,9 @@
 								"JPG" => "JPG Support",
 								"PNG" => "PNG Support"
 						);
+if (defined('X_PHP530_COMPAT'))
+    $gd_req_extensions["JPG"] = "JPEG Support";
+
 $spambot_requirements = "";
 # Check for GD library presence
 if (extension_loaded('gd')) {   # If GD loaded
Index: include/used_functions.php
=================================================================== 
--- include/used_functions.php	2010-04-06 15:16:56.000000000 +0400
+++ include/used_functions.php	2010-04-08 12:30:20.000000000 +0400
@@ -45,13 +45,13 @@
 	'mysql_fetch_row','flush','fflush','strtoupper','fclose','feof','fgets','chop','preg_replace','mysql_error',
 	'ini_get','is_readable','substr','phpinfo','php_uname','sort','is_writable','extension_loaded','function_exists','gd_info',
 	'phpversion','mysql_get_server_info','mysql_get_client_info','mktime','date','uniqid','each','array_sum','fopen','filetype',
-	'md5','preg_match_all','max','array_pop','ceil','round','filemtime','eregi_replace','is_file','fgetcsv',
+	'md5','preg_match_all','max','array_pop','ceil','round','filemtime','is_file','fgetcsv',
 	'sizeof','ord','chr','array_unshift','is_numeric','filesize','substr_count','strcmp','usort','basename',
 	'array_shift','htmlspecialchars','fread','move_uploaded_file','fputs','file','is_link','strftime','str_repeat',
-	'strtr','rename','copy','ltrim','min','end','ereg','sleep','abs','doubleval',
-	'strtolower','is_uploaded_file','dirname','ob_start','ob_get_contents','ob_end_clean','array_reverse','is_string','mt_srand','ereg_replace',
+	'strtr','rename','copy','ltrim','min','end','sleep','abs','doubleval',
+	'strtolower','is_uploaded_file','dirname','ob_start','ob_get_contents','ob_end_clean','array_reverse','is_string','mt_srand',
 	'ftruncate','rewind','array_flip','func_get_args','reset','arsort','extract','strip_tags','is_resource',
-	'is_int','umask','chmod','ini_set','strcasecmp','eregi','getenv','base64_encode','ob_flush',
+	'is_int','umask','chmod','ini_set','strcasecmp','getenv','base64_encode','ob_flush',
 	'ob_get_length','ob_end_flush','func_num_args','strrpos','is_object','is_bool','strncmp','is_double','number_format',
 	'call_user_func_array','is_float','register_shutdown_function','preg_grep','setcookie','array_slice','strncasecmp','is_scalar',
 	'ucfirst','iconv','crc32','dechex','mysql_connect','mysql_select_db','mysql_query','error_log','mysql_errno','mysql_result',
@@ -60,10 +60,10 @@
 	'fsockopen','mkdir','md5_file','preg_replace_callback','array_push','is_integer','microtime','putenv',
 	'chunk_split','mail','pow','ip2long','gmmktime','parse_str','urldecode','get_resource_type','base64_decode','addcslashes','range',
 	'stristr','rsort','htmlentities','rawurlencode','strtotime','class_exists','unpack','fseek','pack','srand','bin2hex','checkdate',
-	'getdate','uasort','array_map','ftell','ksort','krsort','fpassthru','set_magic_quotes_runtime','error_reporting','get_magic_quotes_gpc',
+	'getdate','uasort','array_map','ftell','ksort','krsort','fpassthru','error_reporting','get_magic_quotes_gpc',
 	'get_html_translation_table','ini_get_all','asort','mysql_close','set_error_handler','strrchr','stat','octdec',
 	'is_writeable','touch','gmdate','ucwords','str_pad','compact','chdir','dir','headers_sent','sqrt',
 	'get_defined_vars','call_user_func','parse_ini_file','ftp_connect','ftp_login','ftp_pasv','ftp_fput','ftp_quit','utf8_encode',
 	'mt_rand','sin','getimagesize','uksort','shuffle','html_entity_decode','hexdec','strrev','array_rand','get_defined_functions','fileperms','php_sapi_name',
-	'connection_status','mysql_fetch_assoc','mysql_list_tables','printf','is_callable','array_key_exists'
+	'connection_status','mysql_fetch_assoc','mysql_list_tables','printf','is_callable','array_key_exists','eval'
 );

