Ad Widget

Collapse

fix minus handling in trigger expressions in ffrontend

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dvd
    Junior Member
    • Dec 2005
    • 6

    #1

    fix minus handling in trigger expressions in ffrontend

    then writing trigger expression, minus sign does not accepted by php frontend. This is because arithmetic operations checked by regexp, where '-' is within body of regex, and is interpreded as character range designator.

    this patch fixes it:
    Code:
    --- frontends/php/include/config.inc.php.orig   2005-12-07 16:50:30.000000000 +0500
    +++ frontends/php/include/config.inc.php        2005-12-07 17:02:51.000000000 +0500
    @@ -873,7 +873,7 @@
     //     Replace all <float> <sign> <float> <K|M|G> with 0
     //                     echo "Expression:$expression<br>";
                            $arr="";
    -                       if (eregi('^((.)*)([0-9\.]+[A-Z]{0,1})[ ]*([\&\|\>\<\=\+\-\*\/\#]{1})[ ]*([0-9\.]+[A-Z]{0,1})((.)*)$', $expression, &$arr)) 
    +                       if (eregi('^((.)*)([0-9\.]+[A-Z]{0,1})[ ]*([\&\|\>\<\=\+\*\/\#\-]{1})[ ]*([0-9\.]+[A-Z]{0,1})((.)*)$', $expression, &$arr)) 
                            {
     //                             echo "OK<br>";
     //                             for($i=0;$i<50;$i++)
    apply with patch -p0 in zabbix source dir.
    Last edited by dvd; 13-12-2005, 09:46.
Working...