[icinga-checkins] icinga.org: icinga-web/next: fix TO CV broken with oracle

git at icinga.org git at icinga.org
Mon Apr 29 11:42:07 CEST 2013


Module: icinga-web
Branch: next
Commit: d9a84ba038a75a9cc009c879afe8aef63f8476d4
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=d9a84ba038a75a9cc009c879afe8aef63f8476d4

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Mon Apr 29 11:41:33 2013 +0200

fix TO CV broken with oracle

patch by JM, thanks!

fixes #3970

---

 .../legacylib/filter/IcingaApiSearchFilterIdo.php  |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/app/modules/Api/lib/legacylib/filter/IcingaApiSearchFilterIdo.php b/app/modules/Api/lib/legacylib/filter/IcingaApiSearchFilterIdo.php
index 7bbed6b..ecfd6ee 100644
--- a/app/modules/Api/lib/legacylib/filter/IcingaApiSearchFilterIdo.php
+++ b/app/modules/Api/lib/legacylib/filter/IcingaApiSearchFilterIdo.php
@@ -48,7 +48,11 @@ class IcingaApiSearchFilterIdo extends IcingaApiSearchFilter {
         if ($match == IcingaApiConstants::MATCH_LIKE || $match == IcingaApiConstants::MATCH_NOT_LIKE) {
             $value = str_replace("*","%",$value);
         }
-        $value = preg_replace("/'/","\'",$value);
+        if (strtolower($q->getConnection()->getDriverName()) == "oracle") {
+            $value = str_replace("'","''",$value);
+        } else {
+            $value = preg_replace("/'/","\'",$value);
+        }
         $field = preg_replace("/(.*?) +AS +.+ */i","$1",$field);
 
         $statementSkeleton = $field." ".$match." '".$value."' ";





More information about the icinga-checkins mailing list