]> git.mxchange.org Git - friendica.git/blobdiff - library/dddbl2/inc/exceptions/QueryException.class.php
frio: sanitize $schema only if the variable is initialized
[friendica.git] / library / dddbl2 / inc / exceptions / QueryException.class.php
index 52c6250476c61151cc5181b0f6bee37e2b6bc70a..e282a18c9a722f4a5c91fe1445a77c21fc5d09e1 100644 (file)
@@ -19,7 +19,7 @@ class QueryException extends \Exception {
     * and print them as exception\r
     *\r
     **/\r
-    public function __construct(\PDOStatement $objPDO, $arrQueryDefinition) {\r
+    public function __construct(\PDOStatement $objPDO, array $arrQueryDefinition) {\r
         \r
         $strMessage = self::createErrorMessage($objPDO, $arrQueryDefinition);\r
         \r
@@ -38,7 +38,7 @@ class QueryException extends \Exception {
     * and query definition\r
     *\r
     **/\r
-    private function createErrorMessage($objPDO, $arrQueryDefinition) {\r
+    private function createErrorMessage(\PDOStatement $objPDO, array $arrQueryDefinition) {\r
       \r
       $strMessage  = self::flattenQueryErrorInfo($objPDO);\r
       $strMessage .= self::flattenQueryDefiniton($arrQueryDefinition);\r
@@ -57,7 +57,7 @@ class QueryException extends \Exception {
     * from the driver specific error message\r
     *\r
     **/\r
-    private function flattenQueryErrorInfo($objPDO) {\r
+    private function flattenQueryErrorInfo(\PDOStatement $objPDO) {\r
     \r
       $arrErrorInfo = $objPDO->errorInfo();\r
       \r
@@ -76,16 +76,18 @@ class QueryException extends \Exception {
     * \r
     * @return (string) a text version of the query definition\r
     * \r
-    * create an text, which contains all information \r
-    * of the query definition\r
+    * create an text, which contains all *scalar* information \r
+    * of the query definition. if there are non-scalar information\r
+    * added, the will be excluded from output\r
     *\r
     **/\r
-    private function flattenQueryDefiniton($arrQueryDefinition) {\r
+    private function flattenQueryDefiniton(array $arrQueryDefinition) {\r
       \r
       $strMessage = "\nQuery-Definiton:\n";\r
       \r
       foreach($arrQueryDefinition AS $strKeyword => $strContent)\r
-        $strMessage .= "$strKeyword: $strContent\n";\r
+        if(is_scalar($strContent))\r
+          $strMessage .= "$strKeyword: $strContent\n";\r
       \r
       return $strMessage . "\n";\r
       \r