From 47845f201626e4e2751bd73cd5823f334f47e43d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 23:23:02 +0000 Subject: prefixed reserved variables of _ci_load() in order to not conflict with view file variables --- system/libraries/Loader.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'system/libraries/Loader.php') diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index f833cb713..b78790d6c 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -295,7 +295,7 @@ class CI_Loader { */ function view($view, $vars = array(), $return = FALSE) { - return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); + return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); } // -------------------------------------------------------------------- @@ -312,7 +312,7 @@ class CI_Loader { */ function file($path, $return = FALSE) { - return $this->_ci_load(array('path' => $path, 'return' => $return)); + return $this->_ci_load(array('_ci_path' => $path, '_ci_return' => $return)); } // -------------------------------------------------------------------- @@ -611,25 +611,25 @@ class CI_Loader { function _ci_load($data) { // Set the default data variables - foreach (array('view', 'vars', 'path', 'return') as $val) + foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $val) { $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; } // Set the path to the requested file - if ($path == '') + if ($_ci_path == '') { - $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext == '') ? $view.EXT : $view; - $path = $this->_ci_view_path.$file; + $ext = pathinfo($_ci_view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $_ci_view.EXT : $_ci_view; + $_ci_path = $this->_ci_view_path.$file; } else { - $x = explode('/', $path); + $x = explode('/', $_ci_path); $file = end($x); } - if ( ! file_exists($path)) + if ( ! file_exists($_ci_path)) { show_error('Unable to load the requested file: '.$file); } @@ -658,9 +658,9 @@ class CI_Loader { * the two types and cache them so that views that are embedded within * other views can have access to these variables. */ - if (is_array($vars)) + if (is_array($_ci_vars)) { - $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars); } extract($this->_ci_cached_vars); @@ -684,17 +684,17 @@ class CI_Loader { if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) { - echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace(''.preg_replace("/;*\s*\?>/", "; ?>", str_replace('