From bb0c7702e7f2698aa73c94c891e74ef7d97e5e97 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 12 Jan 2012 05:18:54 -0500
Subject: [PATCH] Allow subqueries of strings in remote API.
---
interface/lib/classes/remoting_lib.inc.php | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php
index 435d74d..1310737 100644
--- a/interface/lib/classes/remoting_lib.inc.php
+++ b/interface/lib/classes/remoting_lib.inc.php
@@ -645,7 +645,11 @@
foreach($primary_id as $key => $val) {
$key = $app->db->quote($key);
$val = $app->db->quote($val);
- $sql_where .= "$key = '$val' AND ";
+ if(strpos($val,'%')) {
+ $sql_where .= "$key like '$val' AND ";
+ } else {
+ $sql_where .= "$key = '$val' AND ";
+ }
}
$sql_where = substr($sql_where,0,-5);
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$sql_where;
--
Gitblit v1.9.1