Smarty 3.1.21 upgrade (see changelog)

This commit is contained in:
Ian
2014-10-19 16:19:01 +02:00
parent 563e5a704c
commit dcae514215
13 changed files with 2113 additions and 2136 deletions
+13 -7
View File
@@ -2,7 +2,7 @@
/**
* Project: Smarty: the PHP compiling template engine
* File: Smarty.class.php
* SVN: $Id: Smarty.class.php 4848 2014-06-08 18:12:09Z Uwe.Tews@googlemail.com $
* SVN: $Id: Smarty.class.php 4897 2014-10-14 22:29:58Z Uwe.Tews@googlemail.com $
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@@ -24,7 +24,7 @@
* @author Uwe Tews
* @author Rodney Rehm
* @package Smarty
* @version 3.1-DEV
* @version 3.1.21
*/
/**
@@ -110,7 +110,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = 'Smarty-3.1.20';
const SMARTY_VERSION = 'Smarty-3.1.21-dev';
/**
* define variable scopes
@@ -662,6 +662,14 @@ class Smarty extends Smarty_Internal_TemplateBase
* @var array
*/
public $merged_templates_func = array();
/**
* Cache of is_file results of loadPlugin()
*
* @var array
*/
public static $_is_file_cache= array();
/**#@-*/
/**
@@ -1372,9 +1380,8 @@ class Smarty extends Smarty_Internal_TemplateBase
// if type is "internal", get plugin from sysplugins
if (strtolower($_name_parts[1]) == 'internal') {
$file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';
if (file_exists($file)) {
if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) {
require_once($file);
return $file;
} else {
return false;
@@ -1392,9 +1399,8 @@ class Smarty extends Smarty_Internal_TemplateBase
$_plugin_dir . strtolower($_plugin_filename),
);
foreach ($names as $file) {
if (file_exists($file)) {
if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) {
require_once($file);
return $file;
}
if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {