Permalink
Browse files

Fix Undefined variable: object error

Change the undefined variable $object to $vars when calling get_object_vars().
This fixes an error when passing an object to a view.
  • Loading branch information...
1 parent 52ba26b commit 9c07c3697bab0bf43e10daf59068497dd3a0a9fd @cfaulkner cfaulkner committed with narfbg Jan 10, 2017
Showing with 2 additions and 2 deletions.
  1. +2 −2 system/core/Loader.php
View
@@ -1368,7 +1368,7 @@ protected function _ci_autoloader()
* Prepare variables for _ci_vars, to be later extract()-ed inside views
*
* Converts objects to associative arrays and filters-out internal
- * variable names (i.e. keys prexied with '_ci_').
+ * variable names (i.e. keys prefixed with '_ci_').
*
* @param mixed $vars
* @return array
@@ -1378,7 +1378,7 @@ protected function _ci_prepare_view_vars($vars)
if ( ! is_array($vars))
{
$vars = is_object($vars)
- ? get_object_vars($object)
+ ? get_object_vars($vars)
: array();
}

2 comments on commit 9c07c36

I think you should change the zip file on CI site. This fix doesn't seem applied on it.

Contributor

zploskey replied Feb 27, 2017

Version 3.1.3 shipped with this bug. Presumably this patch will be included in the next release. Our application has been using the 3.1-stable branch in the interim.

Please sign in to comment.