From 7c8806f784fa2137d4119fc32526a857cfa14452 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Tue, 8 Mar 2016 21:45:18 +0100 Subject: [PATCH 1/2] Fix create_state_index function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shouldn’t be compared to false, but null instead. --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index a1540a48a..cc53abdb7 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1447,7 +1447,7 @@ function rrdtest($path, &$stdOutput, &$stdError) { } function create_state_index($state_name) { - if (dbFetchRow('SELECT * FROM state_indexes WHERE state_name = ?', array($state_name)) === false) { + if (dbFetchRow('SELECT * FROM state_indexes WHERE state_name = ?', array($state_name)) == null) { $insert = array('state_name' => $state_name); return dbInsert($insert, 'state_indexes'); } From 763f0fd24fe5735133436687e753fbc8ab70b3da Mon Sep 17 00:00:00 2001 From: Rosiak Date: Wed, 9 Mar 2016 22:13:57 +0100 Subject: [PATCH 2/2] silly bug --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index cc53abdb7..b9da4a670 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1447,7 +1447,7 @@ function rrdtest($path, &$stdOutput, &$stdError) { } function create_state_index($state_name) { - if (dbFetchRow('SELECT * FROM state_indexes WHERE state_name = ?', array($state_name)) == null) { + if (dbFetchRow('SELECT * FROM state_indexes WHERE state_name = ?', array($state_name)) !== true) { $insert = array('state_name' => $state_name); return dbInsert($insert, 'state_indexes'); }