mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- bugfix {make_nocache} failed when using composer autoloader https://github.com/smarty-php/smarty/issues/275
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
===== 3.1.31-dev ===== (xx.xx.xx)
|
||||
20.08-2016
|
||||
- bugfix {config_load ... scope="global"} shall not throw an arror but fallback to scope="smarty" https://github.com/smarty-php/smarty/issues/274
|
||||
- bugfix {make_nocache} failed when using composer autoloader https://github.com/smarty-php/smarty/issues/275
|
||||
|
||||
14.08.2016
|
||||
- bugfix $smarty_>debugging = true; did E_NOTICE messages when {eval} tag was used https://github.com/smarty-php/smarty/issues/266
|
||||
|
@@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
||||
/**
|
||||
* smarty version
|
||||
*/
|
||||
const SMARTY_VERSION = '3.1.31-dev/5';
|
||||
const SMARTY_VERSION = '3.1.31-dev/6';
|
||||
|
||||
/**
|
||||
* define variable scopes
|
||||
|
@@ -67,7 +67,7 @@ class Smarty_Internal_Extension_Handler
|
||||
/* @var Smarty $data ->smarty */
|
||||
$smarty = isset($data->smarty) ? $data->smarty : $data;
|
||||
if (!isset($smarty->ext->$name)) {
|
||||
$class = 'Smarty_Internal_Method_' . ucfirst($name);
|
||||
$class = 'Smarty_Internal_Method_' . $this->upperCase($name);
|
||||
if (preg_match('/^(set|get)([A-Z].*)$/', $name, $match)) {
|
||||
$pn = '';
|
||||
if (!isset($this->_property_info[ $prop = $match[ 2 ] ])) {
|
||||
@@ -104,6 +104,19 @@ class Smarty_Internal_Extension_Handler
|
||||
return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make first character of name parts upper case
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function upperCase($name) {
|
||||
$_name = explode('_', $name);
|
||||
$_name = array_map('ucfirst', $_name);
|
||||
return implode('_', $_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* set extension property
|
||||
*
|
||||
@@ -129,9 +142,9 @@ class Smarty_Internal_Extension_Handler
|
||||
{
|
||||
// object properties of runtime template extensions will start with '_'
|
||||
if ($property_name[ 0 ] == '_') {
|
||||
$class = 'Smarty_Internal_Runtime_' . ucfirst(substr($property_name, 1));
|
||||
$class = 'Smarty_Internal_Runtime' . $this->upperCase($property_name);
|
||||
} else {
|
||||
$class = 'Smarty_Internal_Method_' . ucfirst($property_name);
|
||||
$class = 'Smarty_Internal_Method_' . $this->upperCase($property_name);
|
||||
}
|
||||
if (!class_exists($class)) {
|
||||
return $this->$property_name = new Smarty_Internal_Undefined($class);
|
||||
|
Reference in New Issue
Block a user