[geeklog-cvs] geeklog: Catch "nothing to do" cases

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Feb 20 10:35:46 EST 2010


changeset 7738:6caa2ad8d56a
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/6caa2ad8d56a
user: Dirk Haun <dirk at haun-online.de>
date: Sat Feb 20 15:26:16 2010 +0100
description:
Catch "nothing to do" cases

diffstat:

 public_html/admin/block.php |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 68e131cc90cc -r 6caa2ad8d56a public_html/admin/block.php
--- a/public_html/admin/block.php	Sat Feb 20 15:17:35 2010 +0100
+++ b/public_html/admin/block.php	Sat Feb 20 15:26:16 2010 +0100
@@ -765,13 +765,17 @@
 
     // disable blocks
     $in = implode(',', $disabled);
-    $sql = "UPDATE {$_TABLES['blocks']} SET is_enabled = 0 WHERE bid IN ($in)";
-    DB_query($sql);
+    if (! empty($in)) {
+        $sql = "UPDATE {$_TABLES['blocks']} SET is_enabled = 0 WHERE bid IN ($in)";
+        DB_query($sql);
+    }
 
     // enable blocks
     $in = implode(',', $enabledblocks);
-    $sql = "UPDATE {$_TABLES['blocks']} SET is_enabled = 1 WHERE bid IN ($in)";
-    DB_query($sql);
+    if (! empty($in)) {
+        $sql = "UPDATE {$_TABLES['blocks']} SET is_enabled = 1 WHERE bid IN ($in)";
+        DB_query($sql);
+    }
 }
 
 /**



More information about the geeklog-cvs mailing list