From 32fd2fb609bb69bbaa90849af7f7ebf56454b81f Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 8 Jan 2016 21:36:53 +0900 Subject: [PATCH] Implement __get() placeholder to prevent a flood of E_NOTICE --- classes/context/Context.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index aee48b1a8..ba8cc5d78 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1945,6 +1945,19 @@ class Context return $url[$ssl_mode][$domain_key]; } + /** + * Magic method to return null instead of throwing E_NOTICE when undefined properties are accessed + * + * We do not define a corresponding __set() because it does not work with assignment by reference. + * + * @param string $key + * @return null + */ + public function __get($key) + { + return null; + } + /** * Set a context value with a key *