]> git.wh0rd.org Git - tt-rss.git/commitdiff
pref-filters: add some sql checks
authorAndrew Dolgov <fox@fakecake.org>
Thu, 18 Nov 2010 20:09:55 +0000 (23:09 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Thu, 18 Nov 2010 20:09:55 +0000 (23:09 +0300)
modules/pref-filters.php

index 95721f7cbd4cca90e563cab14343ffbc43701942..ac6f4e68b7b8728007f22243dbaf518c753c9b7b 100644 (file)
                                                                db_escape_string($line["action_param"])."' AND
                                                                owner_uid = " . $_SESSION["uid"]);
 
-                                               $fg_color = db_fetch_result($tmp_result, 0, "fg_color");
-                                               $bg_color = db_fetch_result($tmp_result, 0, "bg_color");
-       
-                                               $tmp = "<span class=\"labelColorIndicator\" style='color : $fg_color; background-color : $bg_color'>&alpha;</span> " . $line['action_param'];
+                                               if (db_num_rows($tmp_result) != 0) {
+                                                       $fg_color = db_fetch_result($tmp_result, 0, "fg_color");
+                                                       $bg_color = db_fetch_result($tmp_result, 0, "bg_color");
+
+                                                       $tmp = "<span class=\"labelColorIndicator\" style='color : $fg_color; background-color : $bg_color'>&alpha;</span> " . $line['action_param'];
 
-                                               $line['action_param'] = $tmp;
+                                                       $line['action_param'] = $tmp;
+                                               }
                                        }
                                }