]> git.mxchange.org Git - friendica.git/commitdiff
Allow for Integer Literals in PDO Database Driver
authormiqrogroove <miqrogroove@gmail.com>
Thu, 21 Jun 2018 15:42:43 +0000 (11:42 -0400)
committerGitHub <noreply@github.com>
Thu, 21 Jun 2018 15:42:43 +0000 (11:42 -0400)
This should fix things like "LIMIT ?"

include/dba.php

index c0617af8e83524b74b7298ded87bbe68faac0c4d..478a1a10c2d40e673298121290f26676e3878321 100644 (file)
@@ -427,7 +427,12 @@ class dba {
                                }
 
                                foreach ($args AS $param => $value) {
-                                       $stmt->bindParam($param, $args[$param]);
+                                       if (is_int($args[$param])) {
+                                               $data_type = PDO::PARAM_INT;
+                                       } else {
+                                               $data_type = PDO::PARAM_STR;
+                                       }
+                                       $stmt->bindParam($param, $args[$param], $data_type);
                                }
 
                                if (!$stmt->execute()) {