From 880842885bd3e970bb752248ba72fb7b9957bc77 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 16 Oct 2003 17:29:26 +0000 Subject: - Fixed bug #3637: made comment module settings translatable. Patch #13 by Moshe. - Fixed bug #3642: removed duplicate settings from user page. Patch #14 by Moshe. - Fixed bug #3503: added 'forum topic' link to the 'create content' menu. Patch by Gobar. I think this might be more intuitive and consistent code-wise; I don't want to introduce small hacks. - Cache improvement: small cache improvement to prevent SQL errors. Patch by Jeremy. --- includes/common.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index 8587741b7..8aa9e853e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -755,10 +755,8 @@ function cache_get($key) { } function cache_set($cid, $data, $expire = 0) { - if (db_fetch_object(db_query("SELECT cid FROM {cache} WHERE cid = '%s'", $cid))) { - db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d WHERE cid = '%s'", $data, time(), $expire, $cid); - } - else { + db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d WHERE cid = '%s'", $data, time(), $expire, $cid); + if (!db_affected_rows()) { db_query("INSERT INTO {cache} (cid, data, created, expire) VALUES('%s', '%s', %d, %d)", $cid, $data, time(), $expire); } } -- cgit v1.2.3