summaryrefslogtreecommitdiff
path: root/includes/database.pear.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-07-21 15:36:05 +0000
committerDries Buytaert <dries@buytaert.net>2003-07-21 15:36:05 +0000
commitc39562ae036f303f77767f438b89be88a23fe277 (patch)
treefbfc4b3846a8d851b39112c2107fb58428a1d2b4 /includes/database.pear.inc
parentd1b175cec75792d4712b7dc7390855249c942547 (diff)
downloadbrdo-c39562ae036f303f77767f438b89be88a23fe277.tar.gz
brdo-c39562ae036f303f77767f438b89be88a23fe277.tar.bz2
- Fixed node_save() and user_save() bug introduced by table prefix changes.
Modified patches from Gerhard. - Changed the order of the checks in node_teaser(). Patch from Kobus.
Diffstat (limited to 'includes/database.pear.inc')
-rw-r--r--includes/database.pear.inc25
1 files changed, 19 insertions, 6 deletions
diff --git a/includes/database.pear.inc b/includes/database.pear.inc
index ff3b00e4f..36e18c236 100644
--- a/includes/database.pear.inc
+++ b/includes/database.pear.inc
@@ -25,11 +25,18 @@ function db_connect($url) {
function db_query($query) {
$args = func_get_args();
+
$query = db_prefix_tables($query);
if (count($args) > 1) {
- $args = array_map("check_query", $args);
- $args[0] = $query;
- return _db_query(call_user_func_array("sprintf", $args));
+ if(is_array($args[1])){
+ $args1 = array_map("check_query", $args[1]);
+ $nargs = array_merge(array($query), $args1);
+ }
+ else {
+ $nargs = array_map("check_query", $args);
+ $nargs[0] = $query;
+ }
+ return _db_query(call_user_func_array("sprintf", $nargs));
}
else {
return _db_query($query);
@@ -41,9 +48,15 @@ function db_queryd($query) {
$args = func_get_args();
$query = db_prefix_tables($query);
if (count($args) > 1) {
- $args = array_map("check_query", $args);
- $args[0] = $query;
- return _db_query(call_user_func_array("sprintf", $args), 1);
+ if(is_array($args[1])){
+ $args1 = array_map("check_query", $args[1]);
+ $nargs = array_merge(array($query), $args1);
+ }
+ else {
+ $nargs = array_map("check_query", $args);
+ $nargs[0] = $query;
+ }
+ return _db_query(call_user_func_array("sprintf", $nargs), 1);
}
else {
return _db_query($query, 1);