replace {} string access with equivalent substr() to avoid E_STRICT warnings in PHP 5.1

This commit is contained in:
boots
2005-11-23 20:36:05 +00:00
parent 3741b9d6c5
commit fdb25e363f
8 changed files with 31 additions and 29 deletions

View File

@@ -72,13 +72,13 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-88
// escape non-standard chars, such as ms document quotes
$_res = '';
for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
$_ord = ord($string{$_i});
$_ord = ord(substr($string, $_i, 1));
// non-standard char, escape it
if($_ord >= 126){
$_res .= '&#' . $_ord . ';';
}
else {
$_res .= $string{$_i};
$_res .= substr($string, $_i, 1);
}
}
return $_res;