- Timestamp:
- 05/06/11 12:11:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/expressoMail1_2/inc/class.ScriptS.inc.php
r3859 r4242 215 215 216 216 function convert_specialchar($input) { 217 $special_char = false; 218 for ($i = 0; $i < strlen($input); $i++) { 219 if (preg_match('/[^a-z0-9.@~_+=&\'*^\ \-\[\]]/i', $input[$i])) { 220 $special_char = true; 221 $input = preg_replace('/\\' . $input[$i] . '/', '=' . bin2hex($input[$i]), $input); 222 } 223 } 224 225 if ($special_char) { 226 /* * 227 * When using arrays with pattern and replacement, 228 * the keys are processed in the order they appear in the array. 229 * See preg_replace in php.net/preg_replace 230 * */ 231 $patterns[0] = '/=c3/i'; 232 $patterns[1] = '/ /'; 233 $replacements[1] = ''; 234 $replacements[0] = '_'; 235 $input = preg_replace($patterns, $replacements, $input); 236 } 237 238 return($input); 217 $temp_input = $input; 218 $temp_input = imap_8bit($temp_input); 219 220 $patterns[0] = '/ /'; 221 $replacements[0] = '_'; 222 $temp_input = preg_replace($patterns, $replacements, $temp_input); 223 return ($temp_input); 239 224 } 240 225 … … 263 248 $rule['to'] = $this->convert_specialchar($tmp1[4]); 264 249 $tmpSubject = $tmp1[5]; 265 $rule['subject'] = $ this->convert_specialchar($tmp1[5]);250 $rule['subject'] = $rule['subject'] = " [\"" . $this->convert_specialchar($tmp1[5]) . "\", \"" . base64_encode($tmp1[5]) . "\"]"; 266 251 $rule['action'] = $tmp1[6]; 267 252 $rule['action_arg'] = utf8_encode(preg_replace("/\\r\\n/", "\r\n", $tmp1[7])); … … 347 332 $match = ':regex'; 348 333 $newruletext .= "header " . $match . " \"subject\""; 349 $newruletext .= " \"" . $rule['subject'] . "\"";334 $newruletext .= "" . $rule['subject'] . ""; 350 335 $started = 1; 351 336 }
Note: See TracChangeset
for help on using the changeset viewer.