Ticket #615: regras.diff
File regras.diff, 1.6 KB (added by amuller, 15 years ago) |
---|
-
class.ScriptS.inc.php
176 176 177 177 // Escreve a nova regra; 178 178 $this->reply = $this->SieveS->getscript(); 179 179 /* 180 180 if($this->reply){ 181 181 $this->errstr = $this->SieveS->deletescript($this->scriptfile); 182 182 } 183 */ 183 184 184 185 //Escreve a(s) nova(s) regra(s); 185 $this->errstr = $this->SieveS->putscript($this->scriptfile,$this->write_rule()); 186 $newrule = $this->write_rule(); 187 if (strlen($newrule) > 0) 188 $this->errstr = $this->SieveS->putscript($this->scriptfile,$newrule); 189 else 190 return "Invalid rule\n" . $this->teste; 186 191 187 192 //Ativa o script; 188 193 $this->errstr = $this->SieveS->activatescript($this->scriptfile); … … 202 207 $special_char = false; 203 208 for ( $i = 0; $i < strlen($input); $i++ ) 204 209 { 205 if ( preg_match('/[ ÁáÉéÍíÓóÚúÀàÈèÌìÒòÙùüÇçÃãÕõÂâÊêÔô®©§ªºÐ¹²³°¢¿Æ£µøæß«»Ø÷±¬]/', $input[$i]) )210 if ( preg_match('/[^a-zA-z0-9.@~_+=&\'*^\"-]/', $input[$i]) ) 206 211 { 207 212 $special_char = true; 208 213 $input = preg_replace('/'.$input[$i].'/', '=' . bin2hex($input[$i]), $input); … … 226 231 return($input); 227 232 } 228 233 229 // Grava a nova regra;234 // build the rule 230 235 function write_rule(){ 231 236 232 237 // Variaveis; … … 345 350 } 346 351 347 352 } 348 349 // Ações 353 // Don't write half rule! 354 if (strlen($newruletext) == 0) 355 return false; 356 // Actions 350 357 if (!$rule['unconditional']) $newruletext .= ") {\n\t"; 351 358 352 359 if (preg_match("/folder/i",$rule['action']))