change split() to preg_split(), deprecated in php 5.3

This commit is contained in:
monte.ohrt
2009-07-05 05:03:24 +00:00
parent 3463a3a090
commit e348a33cf0
2 changed files with 3 additions and 7 deletions

View File

@@ -179,12 +179,12 @@ function smarty_function_fetch($params, $smarty, $template)
$content .= fgets($fp,4096); $content .= fgets($fp,4096);
} }
fclose($fp); fclose($fp);
$csplit = split("\r\n\r\n",$content,2); $csplit = preg_split("!\r\n\r\n!",$content,2);
$content = $csplit[1]; $content = $csplit[1];
if(!empty($params['assign_headers'])) { if(!empty($params['assign_headers'])) {
$template->assign($params['assign_headers'],split("\r\n",$csplit[0])); $template->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0]));
} }
} }
} else { } else {

View File

@@ -22,11 +22,7 @@
function smarty_modifier_spacify($string, $spacify_char = ' ') function smarty_modifier_spacify($string, $spacify_char = ' ')
{ {
$smarty = Smarty::instance(); $smarty = Smarty::instance();
if ($smarty->has_mb) { return implode($spacify_char, preg_split('//', $string, -1));
return implode($spacify_char, mb_split('//', $string, -1));
} else {
return implode($spacify_char, split('//', $string, -1));
}
} }
?> ?>