Index: trunk/class/config_from_xoops.class.php
===================================================================
--- trunk/class/config_from_xoops.class.php	(revision 133)
+++ trunk/class/config_from_xoops.class.php	(revision 159)
@@ -32,4 +32,5 @@
 	var $xoops_upload_url;
 	var $xoops_db_salt;
+	var $xoops_salt;
 	var $is_impress;
 	var $impress_db_config_file;
@@ -41,4 +42,10 @@
        
     }
+    
+    function xpress_eval($str){
+    	$eval_str = '$ret = ' . $str . ' ;';
+    	eval($eval_str);
+    	return $ret;
+    }
 
     function ConfigFromXoops()	//for PHP4 constructor
@@ -49,5 +56,5 @@
 		if(file_exists($this->xoops_mainfile_path)){
 			$array_file = file($this->xoops_mainfile_path);
-			$pattern = '^\s*define\s*\(\s*(\'[^\']+\'|"[^"]+")\s*,\s*(\'[^\']*\'|"[^"]*"|[^\'"])\s*\)\s*;';
+			$pattern = '^\s*define\s*\(\s*(\'[^\']+\'|"[^"]+")\s*,\s*(\'.*\'|".*"|[^\'"]*)\s*\)\s*;';
 			$impress_include_pattern = '^\s*(include_once|include)\s*\(\s*XOOPS_TRUST_PATH\s*.\s*[\'"]([^\'"]+)[\'"]\s*\)';
 			for ($i = 0 ; $i <count($array_file) ; $i++){
@@ -57,35 +64,37 @@
 					if (preg_match('/^"[^"]*"$/',$keys)) $keys = preg_replace('/"/', '', $keys);
 					$key_value = $matchs[2];
-					if (preg_match('/^\'[^\']*\'$/',$key_value)) $key_value = preg_replace('/\'/', '', $key_value);
-					if (preg_match('/^"[^"]*"$/',$key_value)) $key_value = preg_replace('/"/', '', $key_value);
+
 					switch ($keys){
 						case  'XOOPS_ROOT_PATH':
-							$this->xoops_root_path = $key_value;
+							$this->xoops_root_path = $this->xpress_eval($key_value);
 							$this->xoops_url . '/modules/' . $this->module_name;
 							break;
 						case  'XOOPS_URL':
-							$this->xoops_url = $key_value;
+							$this->xoops_url = $this->xpress_eval($key_value);
 							$this->module_url = $this->xoops_url . '/modules/' . $this->module_name;
 							break;
 						case  'XOOPS_TRUST_PATH':
-							$this->xoops_trust_path = $key_value;
+							$this->xoops_trust_path = $this->xpress_eval($key_value);
 							break;
 						case  'XOOPS_DB_PREFIX':
-							$this->xoops_db_prefix = $key_value;
+							$this->xoops_db_prefix = $this->xpress_eval($key_value);
 							break;
 						case  'XOOPS_DB_NAME':
-							$this->xoops_db_name = $key_value;
+							$this->xoops_db_name = $this->xpress_eval($key_value);
 							break;
 						case  'XOOPS_DB_USER':
-							$this->xoops_db_user = $key_value;
+							$this->xoops_db_user = $this->xpress_eval($key_value);
 							break;
 						case  'XOOPS_DB_PASS':
-							$this->xoops_db_pass = $key_value;
+							$this->xoops_db_pass = $this->xpress_eval($key_value);
 							break;
 						case  'XOOPS_DB_HOST':
-							$this->xoops_db_host = $key_value;
+							$this->xoops_db_host = $this->xpress_eval($key_value);
 							break;
 						case  'XOOPS_DB_SALT':
-							$this->xoops_db_salt = $key_value;
+							$this->xoops_db_salt = $this->xpress_eval($key_value);
+							break;
+						case  'XOOPS_SALT':
+							$this->xoops_salt = $this->xpress_eval($key_value);
 							break;
 						default :
@@ -113,24 +122,23 @@
 						if (preg_match('/^"[^"]*"$/',$keys)) $keys = preg_replace('/"/', '', $keys);
 						$key_value = $matchs[2];
-						if (preg_match('/^\'[^\']*\'$/',$key_value)) $key_value = preg_replace('/\'/', '', $key_value);
-						if (preg_match('/^"[^"]*"$/',$key_value)) $key_value = preg_replace('/"/', '', $key_value);
+
 						switch ($keys){
 							case  'SDATA_DB_SALT':
-								$this->xoops_db_salt = $key_value;
+								$this->xoops_db_salt = $this->xpress_eval($key_value);
 								break;
 							case  'SDATA_DB_PREFIX':
-								$this->xoops_db_prefix = $key_value;
+								$this->xoops_db_prefix = $this->xpress_eval($key_value);
 								break;
 							case  'SDATA_DB_NAME':
-								$this->xoops_db_name = $key_value;
+								$this->xoops_db_name = $this->xpress_eval($key_value);
 								break;
 							case  'SDATA_DB_USER':
-								$this->xoops_db_user = $key_value;
+								$this->xoops_db_user = $this->xpress_eval($key_value);
 								break;
 							case  'SDATA_DB_PASS':
-								$this->xoops_db_pass = $key_value;
+								$this->xoops_db_pass = $this->xpress_eval($key_value);
 								break;
 							case  'SDATA_DB_HOST':
-								$this->xoops_db_host = $key_value;
+								$this->xoops_db_host = $this->xpress_eval($key_value);
 								break;
 							default :
