Changeset 4146
 Timestamp:
 Oct 29, 2009, 9:41:34 AM (11 years ago)
 Location:
 extensions/Mail_supervisor
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

extensions/Mail_supervisor/include/fonctions.php
r4133 r4146 508 508 { 509 509 //======================================================== 510 510 global $erreur_message; 511 511 $a_ajouter=$ajout ; 512 512 … … 524 524 525 525 $a_ajouter = "+ " . str_replace($period_search, $period_match, $a_ajouter) ; 526 527 528 529 $a_ajouter=trimUltime($a_ajouter); 526 $a_ajouter=sup_double_espace($a_ajouter); 527 530 528 $v1 = array(' ','+ ','week','day','hour','minute','seconde',' ',' +',' '); 531 529 $v2 = array('','+', (7*24*60*60) , (24*60*60), (60*60), 60,1,'','+',"*" ); … … 539 537 foreach($new_valeur as $nv) 540 538 { 541 $p += matheval($nv) ; 539 $return = matheval($nv) ; 540 if (strpos("error",$return)===false) { 541 $p += $return ; 542 }else { 543 $erreur_message .= $return . " nv : " . $nv ; 544 } 545 542 546 543 547 } … … 548 552 function matheval($equation) 549 553 { 554 555 $return="error"; 556 557 550 558 $equation = preg_replace("/[^09+\.*\/()%]/","",$equation); 551 552 559 $equation = preg_replace("/([+])([09]{1})(%)/","*(1\$1.0\$2)",$equation); 553 554 560 $equation = preg_replace("/([+])([09]+)(%)/","*(1\$1.\$2)",$equation); 555 556 561 $equation = preg_replace("/([09]+)(%)/",".\$1",$equation); 557 562 … … 559 564 { 560 565 $return = 0; 561 } 562 else 563 { 564 565 eval("\$return=" . $equation . ";" ); 566 } 567 return $return; 566 } else { 567 @eval("\$return=" . $equation . ";" ); 568 } 569 return $return; 570 568 571 } 569 572 570 573 //====================================================================================== 571 function trimUltime($chaine){ 574 function sup_double_espace($chaine){ 575 global $erreur_message; 576 $str_temp = $chaine." "; 577 $sep=" "; 572 578 $chaine = trim($chaine); 573 $chaine = str_replace("\t", " ", $chaine); 574 $chaine = eregi_replace("[ ]+", " ", $chaine); 579 $existe = (strpos($sep.$sep,$chaine )===false) ; 580 while ($existe ){ 581 $str_temp = str_replace($sep.$sep, $sep, $chaine ); 582 if($str_temp == $chaine ) return $chaine ; 583 // $erreur_message .= memo_var($str_temp) ; 584 $chaine = $str_temp; 585 $existe = (strpos($sep.$sep,$chaine )===false) ; 586 } 575 587 return $chaine; 576 588 } 589 577 590 578 591 … … 591 604 if (count($row) > 0) 592 605 { 593 594 $nb = ($row[7])+1; 606 $nb = ($row[7])+1; 595 607 $pays = isset($_POST['pays']) ? $_POST['pays'] : $pays="" ; 596 608 $ville = (isset($_POST['ville'])) ? $_POST['ville']: $ville="" ; 
extensions/Mail_supervisor/main.inc.php
r4132 r4146 24 24 /* 25 25 Plugin Name: Mail supervisor 26 Version: 1. 1.726 Version: 1.2.1.a 27 27 Description: Mail supervisor surveille l'envoie des mails. 28 28 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=315
Note: See TracChangeset
for help on using the changeset viewer.