[icinga-checkins] icinga.org: icinga-web/mfrosch/pendingstates: Fix preg_match that uses a vars without quoting

git at icinga.org git at icinga.org
Wed Mar 13 12:01:12 CET 2013


Module: icinga-web
Branch: mfrosch/pendingstates
Commit: 8586875ad2338410eca508ac880492ed1a3f4aef
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=8586875ad2338410eca508ac880492ed1a3f4aef

Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Wed Mar 13 11:56:21 2013 +0100

Fix preg_match that uses a vars without quoting

---

 .../Api/models/Views/ApiDQLViewModel.class.php     |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/app/modules/Api/models/Views/ApiDQLViewModel.class.php b/app/modules/Api/models/Views/ApiDQLViewModel.class.php
index 5d7f986..63f373e 100755
--- a/app/modules/Api/models/Views/ApiDQLViewModel.class.php
+++ b/app/modules/Api/models/Views/ApiDQLViewModel.class.php
@@ -231,7 +231,7 @@ class API_Views_ApiDQLViewModel extends IcingaBaseModel {
 
     public function getAliasedTableFromDQL($field) {
         $results = array();
-        if(preg_match_all('/([A-Za-z_\.0-9]+?) AS '.$field.'/i',$this->currentQuery->getDql(),$results)) {
+        if(preg_match_all('/([A-Za-z_\.0-9]+?) AS '.preg_quote($field, "/").'/i',$this->currentQuery->getDql(),$results)) {
             return $results[1][0];
 
         } else return $field;





More information about the icinga-checkins mailing list