mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-03 22:01:36 +01:00 
			
		
		
		
	replace {} string access with equivalent substr() to avoid E_STRICT warnings in PHP 5.1
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user