From 02b16d5e570d95e2fcc8ff6e93702bbd099e0fab Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Thu, 30 Jan 2020 10:54:51 -0500 Subject: [PATCH] Return default value on exception for setting() --- app/helpers.php | 4 ++++ public/.htaccess | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers.php b/app/helpers.php index e7b83ccd..ed3e1dd3 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -151,6 +151,8 @@ if (!function_exists('setting')) { * @param $key * @param mixed $default * + * @throws \Exception + * * @return mixed|null */ function setting($key, $default = null) @@ -161,6 +163,8 @@ if (!function_exists('setting')) { $value = $settingRepo->retrieve($key); } catch (SettingNotFound $e) { return $default; + } catch (Exception $e) { + return $default; } return $value; diff --git a/public/.htaccess b/public/.htaccess index e42ba45e..3dc0d319 100755 --- a/public/.htaccess +++ b/public/.htaccess @@ -19,5 +19,5 @@ Options -Indexes # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^ index.php [L] + RewriteRule ^ /index.php [L]