Changeset 51 for trunk/expressoMail1_2/inc/class.ScriptS.inc.php
- Timestamp:
- 08/10/07 14:12:05 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.ScriptS.inc.php
r2 r51 193 193 } 194 194 195 function convert_specialchar($input){ 196 $special_char = false; 197 for ( $i = 0; $i < strlen($input); $i++ ) 198 if ( preg_match('/[áéíóúàèìòùçãõâêôç]/', $input[$i]) ) 199 { 200 $special_char = true; 201 $input = preg_replace('/'.$input[$i].'/', '=' . bin2hex($input[$i]), $input); 202 } 203 if ( $special_char ) 204 { 205 /* When using arrays with pattern and replacement, the keys are processed in the order they appear in the array. See preg_replace in php.net/preg_replace */ 206 $patterns[0] = '/=c3/i'; 207 $patterns[1] = '/ /'; 208 $replacements[1] = ''; 209 $replacements[0] = '_'; 210 $input = preg_replace($patterns, $replacements, $input); 211 } 212 return($input); 213 } 214 195 215 // Grava a nova regra; 196 216 function write_rule(){ … … 211 231 $rule['priority'] = $tmp1[1]; 212 232 $rule['status'] = $tmp1[2]; 213 $rule['from'] = $t mp1[3];214 $rule['to'] = $t mp1[4];215 $rule['subject'] = utf8_encode($tmp1[5]);233 $rule['from'] = $this->convert_specialchar($tmp1[3]); 234 $rule['to'] = $this->convert_specialchar($tmp1[4]); 235 $rule['subject'] = $this->convert_specialchar($tmp1[5]); 216 236 $rule['action'] = $tmp1[6]; 217 237 $rule['action_arg'] = utf8_encode(preg_replace("/\\r\\n/","\r\n",$tmp1[7])); 218 238 $rule['flg'] = $tmp1[8]; 219 239 $rule['field'] = $tmp1[9];
Note: See TracChangeset
for help on using the changeset viewer.