SpawW / zabbix-extras

Zabbix Extras - Patchs e extensões para o Zabbix
http://www.spinola.net.br/blog
35 stars 9 forks source link

Missing "global $DB" in zabbix-translate.php #2

Closed BenoitCattie closed 10 years ago

BenoitCattie commented 11 years ago

Hi,

first, thank a lot for your work ! Those plugins are very usefull for me !!

I have seen a little bug in zabbix-translate.php : "global" declaration is missing, so it always call mysql_real_escape_string function even if $DB['TYPE'] == ZBX_DB_POSTGRESQL.

Sorry for not doing a pull request. I will do it for next request.

So line 180 in zabbix-translate.php :

function quotestr($p_texto) { // Função para colocar aspas com mais segurança
        global $DB;
        return "'".($DB['TYPE'] == ZBX_DB_POSTGRESQL ?
          pg_escape_string($p_texto) :
          mysql_real_escape_string($p_texto))."'";
        //pg_escape_string
}

Best regards. Benoit

SpawW commented 10 years ago

Benoit,

Very thank you for your contribuction. I put a new version of Zabbix-extras here you see ?