]> git.wh0rd.org Git - tt-rss.git/commitdiff
override die on error
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 22 May 2006 11:35:18 +0000 (12:35 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 22 May 2006 11:35:18 +0000 (12:35 +0100)
db-prefs.php

index a33dee80dfc05fa7f778cd7483b8a8f261c81cd8..519b35f236c025a96d0562a54b7e75a365e4e74b 100644 (file)
@@ -7,7 +7,7 @@
                        $_SESSION["prefs_cache"] = array();
        }
 
-       function get_pref($link, $pref_name, $user_id = false) {
+       function get_pref($link, $pref_name, $user_id = false, $die_on_error = true) {
 
                $pref_name = db_escape_string($pref_name);
 
                        return convert_pref_type($value, $type_name);
                        
                } else {                
-                       die("Fatal error, unknown preferences key: $pref_name");                        
+                       if ($die_on_error) {
+                               die("Fatal error, unknown preferences key: $pref_name");
+                       } else {
+                               return null;
+                       }
                }
        }