mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 03:44:26 +02:00
fix __get() return value, and set properties before returning
This commit is contained in:
@@ -662,11 +662,17 @@ class Smarty extends Smarty_Internal_Data {
|
|||||||
* @param string $name property name
|
* @param string $name property name
|
||||||
*/
|
*/
|
||||||
public function __get($name) {
|
public function __get($name) {
|
||||||
|
echo "inside get\n";
|
||||||
if(in_array($name, array('register', 'unregister', 'utility', 'cache'))) {
|
if(in_array($name, array('register', 'unregister', 'utility', 'cache'))) {
|
||||||
$class = "Smarty_Internal_" . ucfirst($name);
|
$class = "Smarty_Internal_" . ucfirst($name);
|
||||||
return new $class($this);
|
$this->$name = new $class($this);
|
||||||
}
|
return $this->$name;
|
||||||
return false;
|
} else if ($name == '_version') {
|
||||||
|
// Smarty 2 BC
|
||||||
|
$this->_version = self::SMARTY_VERSION;
|
||||||
|
return $this->_version;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -733,4 +739,4 @@ function smartyAutoload($class) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user