Index: trunk/kernel/include/config.php =================================================================== diff -u -N -r4926 -r5168 --- trunk/kernel/include/config.php (.../config.php) (revision 4926) +++ trunk/kernel/include/config.php (.../config.php) (revision 5168) @@ -240,29 +240,36 @@ return $s; } - function replace_sql($string) + function replace_sql($string, $start_mark = '') { - $string = str_replace("",GetTablePrefix(),$string); - - $start = strpos($string,""); + $mark_length = strlen($start_mark); + $string = str_replace("",GetTablePrefix(),$string); - while($start) - { - $end = strpos($string,""); - if(!$end) - { - $end = strlen($string); - } - $len = $end - $start; - $sql = substr($string,$start+5,$len-5); - - $sql_val = $this->explode_sql($sql); - $s = substr($string,0,$start) . $sql_val . substr($string,$end+6); - - $string = $s; - $start = strpos($string,""); - } - return preg_replace('/(.*)$,/','\\1', $string); + $start = strpos($string, $start_mark); + + while($start) + { + $end = strpos($string,""); + if(!$end) + { + $end = strlen($string); + } + $len = $end - $start; + $sql = substr($string,$start + $mark_length,$len - $mark_length); + + $sql_val = $this->explode_sql($sql); + $s = substr($string, 0, $start) . $sql_val . substr($string, $end + $mark_length + 1); + + $string = $s; + $start = strpos($string, $start_mark); + } + + if ($start_mark == '') { + // to prevent recursion. check new style of sqls too + $string = $this->replace_sql($string, ''); + } + + return preg_replace('/(.*)$,/','\\1', $string); } function ItemFormElement($StartFrom=1) Index: trunk/kernel/units/general/helpers/modules.php =================================================================== diff -u -N -r4607 -r5168 --- trunk/kernel/units/general/helpers/modules.php (.../modules.php) (revision 4607) +++ trunk/kernel/units/general/helpers/modules.php (.../modules.php) (revision 5168) @@ -111,6 +111,7 @@ */ function _StripDomainHost($d) { + $IsIp = false; $dotcount = substr_count($d, '.'); if ($dotcount == 3) { $IsIp = true; Index: trunk/core/units/general/helpers/modules.php =================================================================== diff -u -N -r4607 -r5168 --- trunk/core/units/general/helpers/modules.php (.../modules.php) (revision 4607) +++ trunk/core/units/general/helpers/modules.php (.../modules.php) (revision 5168) @@ -111,6 +111,7 @@ */ function _StripDomainHost($d) { + $IsIp = false; $dotcount = substr_count($d, '.'); if ($dotcount == 3) { $IsIp = true;