Blob Blame History Raw
From f76503b790d059c59070c69e07a1ebe882aff30f Mon Sep 17 00:00:00 2001
From: Patrick <patrick@patrickrademaker.nl>
Date: Sat, 13 May 2017 00:01:13 +0200
Subject: [PATCH] Bugfix for issue#687

--- a/lib/data_query.php
+++ b/lib/data_query.php
@@ -762,7 +762,7 @@ function data_query_rewrite_indexes(&$errmsg, $host_id, $snmp_query_id, $rewrite
 	foreach($oid_items as $item){
 		$matches = array();
 		if(preg_match('/^\|query_([^|]+)\|$/', $item, $matches)){
-			$iv = mysql_real_escape_string($matches[1]);
+			$iv = db_qstr($matches[1]);
 			if(is_array($fields_processed) && !in_array($iv, $fields_processed)){
 				$errmsg[] = "rewrite_index='$rewrite_index': '$iv' is not processed yet, could not use it as index source";
 					continue;