mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
change split() to preg_split(), deprecated in php 5.3
This commit is contained in:
@@ -179,12 +179,12 @@ function smarty_function_fetch($params, $smarty, $template)
|
||||
$content .= fgets($fp,4096);
|
||||
}
|
||||
fclose($fp);
|
||||
$csplit = split("\r\n\r\n",$content,2);
|
||||
$csplit = preg_split("!\r\n\r\n!",$content,2);
|
||||
|
||||
$content = $csplit[1];
|
||||
|
||||
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 {
|
||||
|
@@ -22,11 +22,7 @@
|
||||
function smarty_modifier_spacify($string, $spacify_char = ' ')
|
||||
{
|
||||
$smarty = Smarty::instance();
|
||||
if ($smarty->has_mb) {
|
||||
return implode($spacify_char, mb_split('//', $string, -1));
|
||||
} else {
|
||||
return implode($spacify_char, split('//', $string, -1));
|
||||
}
|
||||
return implode($spacify_char, preg_split('//', $string, -1));
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user