From 92d1cc05362998ceabe39c4023f41fd939c1f5b2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 11 Mar 2016 18:19:23 +0200 Subject: Add a defensive check in CI_Loader::_ci_load() Prevents possible internal variable overwrites when loading views --- system/core/Loader.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'system') diff --git a/system/core/Loader.php b/system/core/Loader.php index 62781a7bf..c742ae71a 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -936,6 +936,14 @@ class CI_Loader { */ if (is_array($_ci_vars)) { + foreach (array_keys($_ci_vars) as $key) + { + if (strncmp($key, '_ci_', 4) === 0) + { + unset($_ci_vars[$key]); + } + } + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars); } extract($this->_ci_cached_vars); -- cgit v1.2.3-24-g4f1b