Ad Widget

Collapse

SQL Error when inserting IT service with apostrophes (1.1beta5)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cameronsto
    Senior Member
    • Oct 2005
    • 148

    #1

    SQL Error when inserting IT service with apostrophes (1.1beta5)

    Tried to add a service (not linked to a trigger or with 'show sla' marked) with an apostrophe in the name and got a sql error. I was able to fix this by making the following change.
    Add this line:
    Code:
    $name=addslashes($name);
    right before this line (line 50) in include/services.inc.php:
    Code:
    $sql="insert into services (name,status,algorithm,showsla,goodsla,sortorder) values ('$name',0,$algorithm,$showsla,$goodsla,$sortorder)";
    -cameron
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Thanks for reporting this. Will be fixed.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    Working...