From 2ea4c4c5393955ddff54ca4b9b66d09956013f20 Mon Sep 17 00:00:00 2001 From: Sergey Tsalkov Date: Wed, 16 Jun 2021 13:47:08 -0700 Subject: [PATCH] __callStatic() should have proper exception thrown if invalid method is used --- db.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db.class.php b/db.class.php index bac4438..24a61f3 100644 --- a/db.class.php +++ b/db.class.php @@ -58,7 +58,12 @@ class DB { } public static function __callStatic($name, $args) { - return call_user_func_array(array(DB::getMDB(), $name), $args); + $fn = array(DB::getMDB(), $name); + if (! is_callable($fn)) { + throw new MeekroDBException("MeekroDB does not have a method called $name"); + } + + return call_user_func_array($fn, $args); } public static function debugMode($handler = true) {