Ignore:
Timestamp:
08/10/07 14:12:05 (17 years ago)
Author:
niltonneto
Message:

Atualizações da versão nova.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.ScriptS.inc.php

    r2 r51  
    193193        } 
    194194 
     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 
    195215        // Grava a nova regra; 
    196216        function write_rule(){ 
     
    211231                  $rule['priority']      = $tmp1[1]; 
    212232                  $rule['status']        = $tmp1[2]; 
    213           $rule['from']              = $tmp1[3]; 
    214           $rule['to']            = $tmp1[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]); 
    216236          $rule['action']            = $tmp1[6]; 
    217                   $rule['action_arg']    = utf8_encode(preg_replace("/\\r\\n/","\r\n",$tmp1[7])); 
     237          $rule['action_arg']    = utf8_encode(preg_replace("/\\r\\n/","\r\n",$tmp1[7])); 
    218238          $rule['flg']               = $tmp1[8];    
    219239          $rule['field']                 = $tmp1[9]; 
Note: See TracChangeset for help on using the changeset viewer.