From: Andrew Dolgov Date: Mon, 22 May 2006 11:35:18 +0000 (+0100) Subject: override die on error X-Git-Tag: 1.2.0~37 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1e107b0fce48e8f5286c16571af6f6500790c98c;p=tt-rss.git override die on error --- diff --git a/db-prefs.php b/db-prefs.php index a33dee80..519b35f2 100644 --- a/db-prefs.php +++ b/db-prefs.php @@ -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); @@ -49,7 +49,11 @@ 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; + } } }