SF.net SVN: postfixadmin:[1704] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2014-10-23 22:24:09
|
Revision: 1704 http://sourceforge.net/p/postfixadmin/code/1704 Author: christian_boltz Date: 2014-10-23 22:23:53 +0000 (Thu, 23 Oct 2014) Log Message: ----------- update Smarty to 3.1.21 Modified Paths: -------------- trunk/CHANGELOG.TXT trunk/smarty/libs/Smarty.class.php trunk/smarty/libs/SmartyBC.class.php trunk/smarty/libs/debug.tpl trunk/smarty/libs/plugins/block.textformat.php trunk/smarty/libs/plugins/function.counter.php trunk/smarty/libs/plugins/function.cycle.php trunk/smarty/libs/plugins/function.fetch.php trunk/smarty/libs/plugins/function.html_checkboxes.php trunk/smarty/libs/plugins/function.html_image.php trunk/smarty/libs/plugins/function.html_options.php trunk/smarty/libs/plugins/function.html_radios.php trunk/smarty/libs/plugins/function.html_select_date.php trunk/smarty/libs/plugins/function.html_select_time.php trunk/smarty/libs/plugins/function.html_table.php trunk/smarty/libs/plugins/function.mailto.php trunk/smarty/libs/plugins/function.math.php trunk/smarty/libs/plugins/modifier.capitalize.php trunk/smarty/libs/plugins/modifier.date_format.php trunk/smarty/libs/plugins/modifier.debug_print_var.php trunk/smarty/libs/plugins/modifier.escape.php trunk/smarty/libs/plugins/modifier.regex_replace.php trunk/smarty/libs/plugins/modifier.replace.php trunk/smarty/libs/plugins/modifier.spacify.php trunk/smarty/libs/plugins/modifier.truncate.php trunk/smarty/libs/plugins/modifiercompiler.cat.php trunk/smarty/libs/plugins/modifiercompiler.count_characters.php trunk/smarty/libs/plugins/modifiercompiler.count_paragraphs.php trunk/smarty/libs/plugins/modifiercompiler.count_sentences.php trunk/smarty/libs/plugins/modifiercompiler.count_words.php trunk/smarty/libs/plugins/modifiercompiler.default.php trunk/smarty/libs/plugins/modifiercompiler.escape.php trunk/smarty/libs/plugins/modifiercompiler.from_charset.php trunk/smarty/libs/plugins/modifiercompiler.indent.php trunk/smarty/libs/plugins/modifiercompiler.lower.php trunk/smarty/libs/plugins/modifiercompiler.noprint.php trunk/smarty/libs/plugins/modifiercompiler.string_format.php trunk/smarty/libs/plugins/modifiercompiler.strip.php trunk/smarty/libs/plugins/modifiercompiler.strip_tags.php trunk/smarty/libs/plugins/modifiercompiler.to_charset.php trunk/smarty/libs/plugins/modifiercompiler.unescape.php trunk/smarty/libs/plugins/modifiercompiler.upper.php trunk/smarty/libs/plugins/modifiercompiler.wordwrap.php trunk/smarty/libs/plugins/outputfilter.trimwhitespace.php trunk/smarty/libs/plugins/shared.escape_special_chars.php trunk/smarty/libs/plugins/shared.literal_compiler_param.php trunk/smarty/libs/plugins/shared.make_timestamp.php trunk/smarty/libs/plugins/shared.mb_str_replace.php trunk/smarty/libs/plugins/shared.mb_unicode.php trunk/smarty/libs/plugins/shared.mb_wordwrap.php trunk/smarty/libs/plugins/variablefilter.htmlspecialchars.php trunk/smarty/libs/sysplugins/smarty_cacheresource.php trunk/smarty/libs/sysplugins/smarty_cacheresource_custom.php trunk/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php trunk/smarty/libs/sysplugins/smarty_config_source.php trunk/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php trunk/smarty/libs/sysplugins/smarty_internal_compile_append.php trunk/smarty/libs/sysplugins/smarty_internal_compile_assign.php trunk/smarty/libs/sysplugins/smarty_internal_compile_block.php trunk/smarty/libs/sysplugins/smarty_internal_compile_break.php trunk/smarty/libs/sysplugins/smarty_internal_compile_call.php trunk/smarty/libs/sysplugins/smarty_internal_compile_capture.php trunk/smarty/libs/sysplugins/smarty_internal_compile_config_load.php trunk/smarty/libs/sysplugins/smarty_internal_compile_continue.php trunk/smarty/libs/sysplugins/smarty_internal_compile_debug.php trunk/smarty/libs/sysplugins/smarty_internal_compile_eval.php trunk/smarty/libs/sysplugins/smarty_internal_compile_extends.php trunk/smarty/libs/sysplugins/smarty_internal_compile_for.php trunk/smarty/libs/sysplugins/smarty_internal_compile_foreach.php trunk/smarty/libs/sysplugins/smarty_internal_compile_function.php trunk/smarty/libs/sysplugins/smarty_internal_compile_if.php trunk/smarty/libs/sysplugins/smarty_internal_compile_include.php trunk/smarty/libs/sysplugins/smarty_internal_compile_include_php.php trunk/smarty/libs/sysplugins/smarty_internal_compile_insert.php trunk/smarty/libs/sysplugins/smarty_internal_compile_ldelim.php trunk/smarty/libs/sysplugins/smarty_internal_compile_nocache.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php trunk/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php trunk/smarty/libs/sysplugins/smarty_internal_compile_rdelim.php trunk/smarty/libs/sysplugins/smarty_internal_compile_section.php trunk/smarty/libs/sysplugins/smarty_internal_compile_setfilter.php trunk/smarty/libs/sysplugins/smarty_internal_compile_while.php trunk/smarty/libs/sysplugins/smarty_internal_compilebase.php trunk/smarty/libs/sysplugins/smarty_internal_config.php trunk/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php trunk/smarty/libs/sysplugins/smarty_internal_configfilelexer.php trunk/smarty/libs/sysplugins/smarty_internal_configfileparser.php trunk/smarty/libs/sysplugins/smarty_internal_data.php trunk/smarty/libs/sysplugins/smarty_internal_debug.php trunk/smarty/libs/sysplugins/smarty_internal_filter_handler.php trunk/smarty/libs/sysplugins/smarty_internal_function_call_handler.php trunk/smarty/libs/sysplugins/smarty_internal_get_include_path.php trunk/smarty/libs/sysplugins/smarty_internal_nocache_insert.php trunk/smarty/libs/sysplugins/smarty_internal_parsetree.php trunk/smarty/libs/sysplugins/smarty_internal_resource_eval.php trunk/smarty/libs/sysplugins/smarty_internal_resource_extends.php trunk/smarty/libs/sysplugins/smarty_internal_resource_file.php trunk/smarty/libs/sysplugins/smarty_internal_resource_php.php trunk/smarty/libs/sysplugins/smarty_internal_resource_registered.php trunk/smarty/libs/sysplugins/smarty_internal_resource_stream.php trunk/smarty/libs/sysplugins/smarty_internal_resource_string.php trunk/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php trunk/smarty/libs/sysplugins/smarty_internal_template.php trunk/smarty/libs/sysplugins/smarty_internal_templatebase.php trunk/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php trunk/smarty/libs/sysplugins/smarty_internal_templatelexer.php trunk/smarty/libs/sysplugins/smarty_internal_templateparser.php trunk/smarty/libs/sysplugins/smarty_internal_utility.php trunk/smarty/libs/sysplugins/smarty_internal_write_file.php trunk/smarty/libs/sysplugins/smarty_resource.php trunk/smarty/libs/sysplugins/smarty_resource_custom.php trunk/smarty/libs/sysplugins/smarty_resource_recompiled.php trunk/smarty/libs/sysplugins/smarty_resource_uncompiled.php trunk/smarty/libs/sysplugins/smarty_security.php trunk/smarty/smarty_version Modified: trunk/CHANGELOG.TXT =================================================================== --- trunk/CHANGELOG.TXT 2014-10-23 18:26:54 UTC (rev 1703) +++ trunk/CHANGELOG.TXT 2014-10-23 22:23:53 UTC (rev 1704) @@ -24,6 +24,7 @@ - $CONF[default_aliases] can now use the new domain as alias target (patch#124) - check that vacation start/end date are not in the past (patch#122) - update vacation INSTALL.TXT with more secure locations +- update Smarty to 3.1.21 Version 3.0 beta1 (2.91) - 2014/05/06 - SVN r1670 ------------------------------------------------- Modified: trunk/smarty/libs/Smarty.class.php =================================================================== --- trunk/smarty/libs/Smarty.class.php 2014-10-23 18:26:54 UTC (rev 1703) +++ trunk/smarty/libs/Smarty.class.php 2014-10-23 22:23:53 UTC (rev 1704) @@ -2,33 +2,29 @@ /** * Project: Smarty: the PHP compiling template engine * File: Smarty.class.php - * SVN: $Id: Smarty.class.php 4800 2013-12-15 15:19:01Z Uwe...@go... $ - * + * SVN: $Id: Smarty.class.php 4897 2014-10-14 22:29:58Z Uwe...@go... $ * 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 * version 2.1 of the License, or (at your option) any later version. - * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * For questions, help, comments, discussion, etc., please join the * Smarty mailing list. Send a blank e-mail to * sma...@go... * - * @link http://www.smarty.net/ + * @link http://www.smarty.net/ * @copyright 2008 New Digital Group, Inc. - * @author Monte Ohrt <monte at ohrt dot com> - * @author Uwe Tews - * @author Rodney Rehm - * @package Smarty - * @version 3.1-DEV + * @author Monte Ohrt <monte at ohrt dot com> + * @author Uwe Tews + * @author Rodney Rehm + * @package Smarty + * @version 3.1.21 */ /** @@ -92,16 +88,17 @@ /** * Load always needed external class files */ -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_data.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_templatebase.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_template.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_resource.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_resource_file.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_cacheresource.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_cacheresource_file.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_cacheresource_file.php'; /** * This is the main Smarty class + * * @package Smarty */ class Smarty extends Smarty_Internal_TemplateBase @@ -113,7 +110,7 @@ /** * smarty version */ - const SMARTY_VERSION = 'Smarty-3.1.16'; + const SMARTY_VERSION = 'Smarty-3.1.21-dev'; /** * define variable scopes @@ -131,7 +128,7 @@ /** * define constant for clearing cache files be saved expiration datees */ - const CLEAR_EXPIRED = -1; + const CLEAR_EXPIRED = - 1; /** * define compile check modes @@ -206,111 +203,133 @@ /** * auto literal on delimiters with whitspace + * * @var boolean */ public $auto_literal = true; /** * display error on not assigned variables + * * @var boolean */ public $error_unassigned = false; /** * look up relative filepaths in include_path + * * @var boolean */ public $use_include_path = false; /** * template directory + * * @var array */ private $template_dir = array(); /** * joined template directory string used in cache keys + * * @var string */ public $joined_template_dir = null; /** * joined config directory string used in cache keys + * * @var string */ public $joined_config_dir = null; /** * default template handler + * * @var callable */ public $default_template_handler_func = null; /** * default config handler + * * @var callable */ public $default_config_handler_func = null; /** * default plugin handler + * * @var callable */ public $default_plugin_handler_func = null; /** * compile directory + * * @var string */ private $compile_dir = null; /** * plugins directory + * * @var array */ private $plugins_dir = array(); /** * cache directory + * * @var string */ private $cache_dir = null; /** * config directory + * * @var array */ private $config_dir = array(); /** * force template compiling? + * * @var boolean */ public $force_compile = false; /** * check template for modifications? + * * @var boolean */ public $compile_check = true; /** * use sub dirs for compiled/cached files? + * * @var boolean */ public $use_sub_dirs = false; /** * allow ambiguous resources (that are made unique by the resource handler) + * * @var boolean */ public $allow_ambiguous_resources = false; /** * caching enabled + * * @var boolean */ public $caching = false; /** * merge compiled includes + * * @var boolean */ public $merge_compiled_includes = false; /** * template inheritance merge compiled includes + * * @var boolean - */ + */ public $inheritance_merge_compiled_includes = true; /** * cache lifetime in seconds + * * @var integer */ public $cache_lifetime = 3600; /** * force cache file creation + * * @var boolean */ public $force_cache = false; @@ -330,11 +349,13 @@ public $compile_id = null; /** * template left-delimiter + * * @var string */ public $left_delimiter = "{"; /** * template right-delimiter + * * @var string */ public $right_delimiter = "}"; @@ -343,7 +364,6 @@ */ /** * class name - * * This should be instance of Smarty_Security. * * @var string @@ -370,7 +390,6 @@ public $allow_php_templates = false; /** * Should compiled-templates be prevented from being called directly? - * * {@internal * Currently used by Smarty_Internal_Template only. * }} @@ -381,7 +400,6 @@ /**#@-*/ /** * debug mode - * * Setting this to true enables the debug-console. * * @var boolean @@ -393,12 +411,12 @@ * <li>NONE => no debugging control allowed</li> * <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li> * </ul> + * * @var string */ public $debugging_ctrl = 'NONE'; /** * Name of debugging URL-param. - * * Only used when $debugging_ctrl is set to 'URL'. * The name of the URL-parameter that activates debugging. * @@ -407,16 +425,19 @@ public $smarty_debug_id = 'SMARTY_DEBUG'; /** * Path of debug template. + * * @var string */ public $debug_tpl = null; /** * When set, smarty uses this value as error_reporting-level. + * * @var int */ public $error_reporting = null; /** * Internal flag for getTags() + * * @var boolean */ public $get_used_tags = false; @@ -427,16 +448,19 @@ /** * Controls whether variables with the same name overwrite each other. + * * @var boolean */ public $config_overwrite = true; /** * Controls whether config values of on/true/yes and off/false/no get converted to boolean. + * * @var boolean */ public $config_booleanize = true; /** * Controls whether hidden config sections/vars are read from the file. + * * @var boolean */ public $config_read_hidden = false; @@ -449,16 +473,19 @@ /** * locking concurrent compiles + * * @var boolean */ public $compile_locking = true; /** * Controls whether cache resources should emply locking mechanism + * * @var boolean */ public $cache_locking = false; /** * seconds to wait for acquiring a lock before ignoring the write lock + * * @var float */ public $locking_timeout = 10; @@ -467,19 +494,19 @@ /** * global template functions + * * @var array */ public $template_functions = array(); /** * resource type used if none given + * Must be an valid key of $registered_resources. * - * Must be an valid key of $registered_resources. * @var string */ public $default_resource_type = 'file'; /** * caching type - * * Must be an element of $cache_resource_types. * * @var string @@ -487,121 +514,145 @@ public $caching_type = 'file'; /** * internal config properties + * * @var array */ public $properties = array(); /** * config type + * * @var string */ public $default_config_type = 'file'; /** * cached template objects + * * @var array */ public $template_objects = array(); /** * check If-Modified-Since headers + * * @var boolean */ public $cache_modified_check = false; /** * registered plugins + * * @var array */ public $registered_plugins = array(); /** * plugin search order + * * @var array */ public $plugin_search_order = array('function', 'block', 'compiler', 'class'); /** * registered objects + * * @var array */ public $registered_objects = array(); /** * registered classes + * * @var array */ public $registered_classes = array(); /** * registered filters + * * @var array */ public $registered_filters = array(); /** * registered resources + * * @var array */ public $registered_resources = array(); /** * resource handler cache + * * @var array */ public $_resource_handlers = array(); /** * registered cache resources + * * @var array */ public $registered_cache_resources = array(); /** * cache resource handler cache + * * @var array */ public $_cacheresource_handlers = array(); /** * autoload filter + * * @var array */ public $autoload_filters = array(); /** * default modifier + * * @var array */ public $default_modifiers = array(); /** * autoescape variable output + * * @var boolean */ public $escape_html = false; /** * global internal smarty vars + * * @var array */ public static $_smarty_vars = array(); /** * start time for execution time calculation + * * @var int */ public $start_time = 0; /** * default file permissions + * * @var int */ public $_file_perms = 0644; /** * default dir permissions + * * @var int */ public $_dir_perms = 0771; /** * block tag hierarchy + * * @var array */ public $_tag_stack = array(); /** * self pointer to Smarty object + * * @var Smarty */ public $smarty; /** * required by the compiler for BC + * * @var string */ public $_current_file = null; /** * internal flag to enable parser debugging + * * @var bool */ public $_parserdebug = false; @@ -611,11 +662,19 @@ * @var array */ public $merged_templates_func = array(); + + /** + * Cache of is_file results of loadPlugin() + * + * @var array + */ + public static $_is_file_cache= array(); + /**#@-*/ /** * Initialize new Smarty object - * + */ public function __construct() { @@ -656,33 +715,32 @@ /** * <<magic>> Generic getter. - * * Calls the appropriate getter function. * Issues an E_USER_NOTICE if no valid getter is found. * * @param string $name property name + * * @return mixed */ public function __get($name) { $allowed = array( - 'template_dir' => 'getTemplateDir', - 'config_dir' => 'getConfigDir', - 'plugins_dir' => 'getPluginsDir', - 'compile_dir' => 'getCompileDir', - 'cache_dir' => 'getCacheDir', + 'template_dir' => 'getTemplateDir', + 'config_dir' => 'getConfigDir', + 'plugins_dir' => 'getPluginsDir', + 'compile_dir' => 'getCompileDir', + 'cache_dir' => 'getCacheDir', ); if (isset($allowed[$name])) { return $this->{$allowed[$name]}(); } else { - trigger_error('Undefined property: '. get_class($this) .'::$'. $name, E_USER_NOTICE); + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); } } /** * <<magic>> Generic setter. - * * Calls the appropriate setter function. * Issues an E_USER_NOTICE if no valid setter is found. * @@ -692,11 +750,11 @@ public function __set($name, $value) { $allowed = array( - 'template_dir' => 'setTemplateDir', - 'config_dir' => 'setConfigDir', - 'plugins_dir' => 'setPluginsDir', - 'compile_dir' => 'setCompileDir', - 'cache_dir' => 'setCacheDir', + 'template_dir' => 'setTemplateDir', + 'config_dir' => 'setConfigDir', + 'plugins_dir' => 'setPluginsDir', + 'compile_dir' => 'setCompileDir', + 'cache_dir' => 'setCacheDir', ); if (isset($allowed[$name])) { @@ -709,7 +767,8 @@ /** * Check if a template resource exists * - * @param string $resource_name template name + * @param string $resource_name template name + * * @return boolean status */ public function templateExists($resource_name) @@ -727,8 +786,8 @@ /** * Returns a single or all global variables * - * @param object $smarty * @param string $varname variable name or null + * * @return string variable value or or array of variables */ public function getGlobal($varname = null) @@ -754,6 +813,7 @@ * * @param integer $exp_time expiration time * @param string $type resource type + * * @return integer number of cache files deleted */ public function clearAllCache($exp_time = null, $type = null) @@ -773,6 +833,7 @@ * @param string $compile_id compile id * @param integer $exp_time expiration time * @param string $type resource type + * * @return integer number of cache files deleted */ public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) @@ -788,6 +849,7 @@ * Loads security class and enables security * * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * * @return Smarty current Smarty instance for chaining * @throws SmartyException when an invalid class name is provided */ @@ -816,6 +878,7 @@ /** * Disable security + * * @return Smarty current Smarty instance for chaining */ public function disableSecurity() @@ -829,13 +892,14 @@ * Set template directory * * @param string|array $template_dir directory(s) of template sources + * * @return Smarty current Smarty instance for chaining */ public function setTemplateDir($template_dir) { $this->template_dir = array(); foreach ((array) $template_dir as $k => $v) { - $this->template_dir[$k] = rtrim($v, '/\\') . DS; + $this->template_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; } $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); @@ -846,32 +910,37 @@ /** * Add template directory(s) * - * @param string|array $template_dir directory(s) of template sources - * @param string $key of the array element to assign the template dir to + * @param string|array $template_dir directory(s) of template sources + * @param string $key of the array element to assign the template dir to + * * @return Smarty current Smarty instance for chaining * @throws SmartyException when the given template directory is not valid */ - public function addTemplateDir($template_dir, $key=null) + public function addTemplateDir($template_dir, $key = null) { // make sure we're dealing with an array $this->template_dir = (array) $this->template_dir; if (is_array($template_dir)) { foreach ($template_dir as $k => $v) { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; if (is_int($k)) { // indexes are not merged but appended - $this->template_dir[] = rtrim($v, '/\\') . DS; + $this->template_dir[] = $v; } else { // string indexes are overridden - $this->template_dir[$k] = rtrim($v, '/\\') . DS; + $this->template_dir[$k] = $v; } } - } elseif ($key !== null) { - // override directory at specified index - $this->template_dir[$key] = rtrim($template_dir, '/\\') . DS; } else { - // append new directory - $this->template_dir[] = rtrim($template_dir, '/\\') . DS; + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($template_dir, '/\\')) . DS; + if ($key !== null) { + // override directory at specified index + $this->template_dir[$key] = $v; + } else { + // append new directory + $this->template_dir[] = $v; + } } $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); @@ -881,10 +950,11 @@ /** * Get template directories * - * @param mixed index of directory to get, null to get all + * @param mixed $index index of directory to get, null to get all + * * @return array|string list of template directories, or directory of $index */ - public function getTemplateDir($index=null) + public function getTemplateDir($index = null) { if ($index !== null) { return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null; @@ -896,14 +966,15 @@ /** * Set config directory * - * @param string|array $template_dir directory(s) of configuration sources + * @param $config_dir + * * @return Smarty current Smarty instance for chaining */ public function setConfigDir($config_dir) { $this->config_dir = array(); foreach ((array) $config_dir as $k => $v) { - $this->config_dir[$k] = rtrim($v, '/\\') . DS; + $this->config_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; } $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); @@ -914,31 +985,36 @@ /** * Add config directory(s) * - * @param string|array $config_dir directory(s) of config sources - * @param string key of the array element to assign the config dir to + * @param string|array $config_dir directory(s) of config sources + * @param mixed $key key of the array element to assign the config dir to + * * @return Smarty current Smarty instance for chaining */ - public function addConfigDir($config_dir, $key=null) + public function addConfigDir($config_dir, $key = null) { // make sure we're dealing with an array $this->config_dir = (array) $this->config_dir; if (is_array($config_dir)) { foreach ($config_dir as $k => $v) { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; if (is_int($k)) { // indexes are not merged but appended - $this->config_dir[] = rtrim($v, '/\\') . DS; + $this->config_dir[] = $v; } else { // string indexes are overridden - $this->config_dir[$k] = rtrim($v, '/\\') . DS; + $this->config_dir[$k] = $v; } } - } elseif ($key !== null) { - // override directory at specified index - $this->config_dir[$key] = rtrim($config_dir, '/\\') . DS; } else { - // append new directory - $this->config_dir[] = rtrim($config_dir, '/\\') . DS; + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($config_dir, '/\\')) . DS; + if ($key !== null) { + // override directory at specified index + $this->config_dir[$key] = rtrim($v, '/\\') . DS; + } else { + // append new directory + $this->config_dir[] = rtrim($v, '/\\') . DS; + } } $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); @@ -949,10 +1025,11 @@ /** * Get config directory * - * @param mixed index of directory to get, null to get all + * @param mixed $index index of directory to get, null to get all + * * @return array|string configuration directory */ - public function getConfigDir($index=null) + public function getConfigDir($index = null) { if ($index !== null) { return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null; @@ -965,6 +1042,7 @@ * Set plugins directory * * @param string|array $plugins_dir directory(s) of plugins + * * @return Smarty current Smarty instance for chaining */ public function setPluginsDir($plugins_dir) @@ -980,8 +1058,8 @@ /** * Adds directory of plugin files * - * @param object $smarty - * @param string $ |array $ plugins folder + * @param $plugins_dir + * * @return Smarty current Smarty instance for chaining */ public function addPluginsDir($plugins_dir) @@ -1023,6 +1101,7 @@ * Set compile directory * * @param string $compile_dir directory to store compiled templates in + * * @return Smarty current Smarty instance for chaining */ public function setCompileDir($compile_dir) @@ -1049,6 +1128,7 @@ * Set cache directory * * @param string $cache_dir directory to store cached templates in + * * @return Smarty current Smarty instance for chaining */ public function setCacheDir($cache_dir) @@ -1075,6 +1155,7 @@ * Set default modifiers * * @param array|string $modifiers modifier or list of modifiers to set + * * @return Smarty current Smarty instance for chaining */ public function setDefaultModifiers($modifiers) @@ -1088,6 +1169,7 @@ * Add default modifiers * * @param array|string $modifiers modifier or list of modifiers to add + * * @return Smarty current Smarty instance for chaining */ public function addDefaultModifiers($modifiers) @@ -1111,15 +1193,15 @@ return $this->default_modifiers; } - /** * Set autoload filters * * @param array $filters filters to load automatically * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * * @return Smarty current Smarty instance for chaining */ - public function setAutoloadFilters($filters, $type=null) + public function setAutoloadFilters($filters, $type = null) { if ($type !== null) { $this->autoload_filters[$type] = (array) $filters; @@ -1135,9 +1217,10 @@ * * @param array $filters filters to load automatically * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * * @return Smarty current Smarty instance for chaining */ - public function addAutoloadFilters($filters, $type=null) + public function addAutoloadFilters($filters, $type = null) { if ($type !== null) { if (!empty($this->autoload_filters[$type])) { @@ -1162,9 +1245,10 @@ * Get autoload filters * * @param string $type type of filter to get autoloads for. Defaults to all autoload filters + * * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified */ - public function getAutoloadFilters($type=null) + public function getAutoloadFilters($type = null) { if ($type !== null) { return isset($this->autoload_filters[$type]) ? $this->autoload_filters[$type] : array(); @@ -1186,7 +1270,8 @@ /** * set the debug template * - * @param string $tpl_name + * @param string $tpl_name + * * @return Smarty current Smarty instance for chaining * @throws SmartyException if file is not readable */ @@ -1208,15 +1293,16 @@ * @param mixed $compile_id compile id to be used with this template * @param object $parent next higher level of Smarty variables * @param boolean $do_clone flag is Smarty object shall be cloned + * * @return object template object */ public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) { - if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) { + if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) { $parent = $cache_id; $cache_id = null; } - if (!empty($parent) && is_array($parent)) { + if ($parent !== null && is_array($parent)) { $data = $parent; $parent = null; } else { @@ -1267,7 +1353,6 @@ return $tpl; } - /** * Takes unknown classes and loads plugin files for them * class name format: Smarty_PluginType_PluginName @@ -1275,6 +1360,8 @@ * * @param string $plugin_name class plugin name to load * @param bool $check check if already loaded + * + * @throws SmartyException * @return string |boolean filepath of loaded file or false */ public function loadPlugin($plugin_name, $check = true) @@ -1289,15 +1376,12 @@ // count($_name_parts) < 3 === !isset($_name_parts[2]) if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') { throw new SmartyException("plugin {$plugin_name} is not a valid name format"); - - return false; } // 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; @@ -1315,9 +1399,8 @@ $_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)) { @@ -1343,10 +1426,11 @@ /** * Compile all template files * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * * @return integer number of template files recompiled */ public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) @@ -1357,10 +1441,11 @@ /** * Compile all config files * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * * @return integer number of template files recompiled */ public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null) @@ -1374,6 +1459,7 @@ * @param string $resource_name template name * @param string $compile_id compile id * @param integer $exp_time expiration time + * * @return integer number of template files deleted */ public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) @@ -1381,11 +1467,11 @@ return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this); } - /** * Return array of tag/attributes of all tags used by an template * - * @param object $templae template object + * @param Smarty_Internal_Template $template + * * @return array of tag/attributes */ public function getTags(Smarty_Internal_Template $template) @@ -1396,10 +1482,11 @@ /** * Run installation test * - * @param array $errors Array to write errors into, rather than outputting them + * @param array $errors Array to write errors into, rather than outputting them + * * @return boolean true if setup is fine, false if something is wrong */ - public function testInstall(&$errors=null) + public function testInstall(&$errors = null) { return Smarty_Internal_Utility::testInstall($this, $errors); } @@ -1408,7 +1495,13 @@ * Error Handler to mute expected messages * * @link http://php.net/set_error_handler + * * @param integer $errno Error level + * @param $errstr + * @param $errfile + * @param $errline + * @param $errcontext + * * @return boolean */ public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) @@ -1420,7 +1513,7 @@ $smarty_dir = realpath(SMARTY_DIR); if ($smarty_dir !== false) { Smarty::$_muted_directories[SMARTY_DIR] = array( - 'file' => $smarty_dir, + 'file' => $smarty_dir, 'length' => strlen($smarty_dir), ); } @@ -1437,7 +1530,7 @@ continue; } $dir = array( - 'file' => $file, + 'file' => $file, 'length' => strlen($file), ); } @@ -1511,6 +1604,7 @@ /** * Smarty exception class + * * @package Smarty */ class SmartyException extends Exception @@ -1519,12 +1613,13 @@ public function __toString() { - return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; + return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; } } /** * Smarty compiler exception class + * * @package Smarty */ class SmartyCompilerException extends SmartyException @@ -1533,23 +1628,28 @@ { return ' --> Smarty Compiler: ' . $this->message . ' <-- '; } + /** * The line number of the template error + * * @type int|null */ public $line = null; /** * The template source snippet relating to the error + * * @type string|null */ public $source = null; /** * The raw text of the error message + * * @type string|null */ public $desc = null; /** * The resource identifier or template name + * * @type string|null */ public $template = null; @@ -1562,16 +1662,16 @@ { $_class = strtolower($class); static $_classes = array( - 'smarty_config_source' => true, - 'smarty_config_compiled' => true, - 'smarty_security' => true, - 'smarty_cacheresource' => true, - 'smarty_cacheresource_custom' => true, + 'smarty_config_source' => true, + 'smarty_config_compiled' => true, + 'smarty_security' => true, + 'smarty_cacheresource' => true, + 'smarty_cacheresource_custom' => true, 'smarty_cacheresource_keyvaluestore' => true, - 'smarty_resource' => true, - 'smarty_resource_custom' => true, - 'smarty_resource_uncompiled' => true, - 'smarty_resource_recompiled' => true, + 'smarty_resource' => true, + 'smarty_resource_custom' => true, + 'smarty_resource_uncompiled' => true, + 'smarty_resource_recompiled' => true, ); if (!strncmp($_class, 'smarty_internal_', 16) || isset($_classes[$_class])) { Modified: trunk/smarty/libs/SmartyBC.class.php =================================================================== --- trunk/smarty/libs/SmartyBC.class.php 2014-10-23 18:26:54 UTC (rev 1703) +++ trunk/smarty/libs/SmartyBC.class.php 2014-10-23 22:23:53 UTC (rev 1704) @@ -3,36 +3,32 @@ * Project: Smarty: the PHP compiling template engine * File: SmartyBC.class.php * SVN: $Id$ - * * 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 * version 2.1 of the License, or (at your option) any later version. - * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * For questions, help, comments, discussion, etc., please join the * Smarty mailing list. Send a blank e-mail to * sma...@go... * - * @link http://www.smarty.net/ + * @link http://www.smarty.net/ * @copyright 2008 New Digital Group, Inc. - * @author Monte Ohrt <monte at ohrt dot com> - * @author Uwe Tews - * @author Rodney Rehm - * @package Smarty + * @author Monte Ohrt <monte at ohrt dot com> + * @author Uwe Tews + * @author Rodney Rehm + * @package Smarty */ /** * @ignore */ -require(dirname(__FILE__) . '/Smarty.class.php'); +require_once(dirname(__FILE__) . '/Smarty.class.php'); /** * Smarty Backward Compatability Wrapper Class @@ -43,6 +39,7 @@ { /** * Smarty 2 BC + * * @var string */ public $_version = self::SMARTY_VERSION; @@ -52,7 +49,7 @@ * * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false ) */ - public function __construct(array $options=array()) + public function __construct(array $options = array()) { parent::__construct($options); // register {php} tag @@ -100,7 +97,7 @@ * @param bool $cacheable * @param mixed $cache_attrs */ - public function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null) + public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null) { $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs); } @@ -118,11 +115,14 @@ /** * Registers object to be used in templates * - * @param string $object name of template object - * @param object $object_impl the referenced PHP object to register - * @param array $allowed list of allowed methods (empty = all) - * @param boolean $smarty_args smarty argument format, else traditional - * @param array $block_functs list of methods that are block format + * @param string $object name of template object + * @param object $object_impl the referenced PHP object to register + * @param array $allowed list of allowed methods (empty = all) + * @param boolean $smarty_args smarty argument format, else traditional + * @param array $block_methods list of methods that are block format + * + * @throws SmartyException + * @internal param array $block_functs list of methods that are block format */ public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) { @@ -144,12 +144,12 @@ /** * Registers block function to be used in templates * - * @param string $block name of template block - * @param string $block_impl PHP function to register + * @param string $block name of template block + * @param string $block_impl PHP function to register * @param bool $cacheable * @param mixed $cache_attrs */ - public function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null) + public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null) { $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs); } @@ -171,7 +171,7 @@ * @param string $function_impl name of PHP function to register * @param bool $cacheable */ - public function register_compiler_function($function, $function_impl, $cacheable=true) + public function register_compiler_function($function, $function_impl, $cacheable = true) { $this->registerPlugin('compiler', $function, $function_impl, $cacheable); } @@ -305,10 +305,11 @@ /** * clear cached content for the given template and cache id * - * @param string $tpl_file name of template file - * @param string $cache_id name of cache_id - * @param string $compile_id name of compile_id - * @param string $exp_time expiration time + * @param string $tpl_file name of template file + * @param string $cache_id name of cache_id + * @param string $compile_id name of compile_id + * @param string $exp_time expiration time + * * @return boolean */ public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) @@ -319,7 +320,8 @@ /** * clear the entire contents of cache (all templates) * - * @param string $exp_time expire time + * @param string $exp_time expire time + * * @return boolean */ public function clear_all_cache($exp_time = null) @@ -330,9 +332,10 @@ /** * test to see if valid cache exists for this template * - * @param string $tpl_file name of template file - * @param string $cache_id - * @param string $compile_id + * @param string $tpl_file name of template file + * @param string $cache_id + * @param string $compile_id + * * @return boolean */ public function is_cached($tpl_file, $cache_id = null, $compile_id = null) @@ -353,9 +356,10 @@ * or all compiled template files if one is not specified. * This function is for advanced use only, not normally needed. * - * @param string $tpl_file - * @param string $compile_id - * @param string $exp_time + * @param string $tpl_file + * @param string $compile_id + * @param string $exp_time + * * @return boolean results of {@link smarty_core_rm_auto()} */ public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) @@ -366,7 +370,8 @@ /** * Checks whether requested template exists. * - * @param string $tpl_file + * @param string $tpl_file + * * @return boolean */ public function template_exists($tpl_file) @@ -378,9 +383,10 @@ * Returns an array containing template variables * * @param string $name + * * @return array */ - public function get_template_vars($name=null) + public function get_template_vars($name = null) { return $this->getTemplateVars($name); } @@ -389,9 +395,10 @@ * Returns an array containing config variables * * @param string $name + * * @return array */ - public function get_config_vars($name=null) + public function get_config_vars($name = null) { return $this->getConfigVars($name); } @@ -412,6 +419,7 @@ * return a reference to a registered object * * @param string $name + * * @return object */ public function get_registered_object($name) @@ -439,7 +447,6 @@ { trigger_error("Smarty error: $error_msg", $error_type); } - } /** @@ -449,6 +456,7 @@ * @param string $content contents of the block * @param object $template template object * @param boolean &$repeat repeat flag + * * @return string content re-formatted */ function smarty_php_tag($params, $content, $template, &$repeat) Modified: trunk/smarty/libs/debug.tpl =================================================================== --- trunk/smarty/libs/debug.tpl 2014-10-23 18:26:54 UTC (rev 1703) +++ trunk/smarty/libs/debug.tpl 2014-10-23 22:23:53 UTC (rev 1704) @@ -1,133 +1,137 @@ {capture name='_smarty_debug' assign=debug_output} -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> -<head> - <title>Smarty Debug Console</title> -<style type="text/css"> -{literal} -body, h1, h2, td, th, p { - font-family: sans-serif; - font-weight: normal; - font-size: 0.9em; - margin: 1px; - padding: 0; -} + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>Smarty Debug Console</title> + <style type="text/css"> + {literal} + body, h1, h2, td, th, p { + font-family: sans-serif; + font-weight: normal; + font-size: 0.9em; + margin: 1px; + padding: 0; + } -h1 { - margin: 0; - text-align: left; - padding: 2px; - background-color: #f0c040; - color: black; - font-weight: bold; - font-size: 1.2em; - } + h1 { + margin: 0; + text-align: left; + padding: 2px; + background-color: #f0c040; + color: black; + font-weight: bold; + font-size: 1.2em; + } -h2 { - background-color: #9B410E; - color: white; - text-align: left; - font-weight: bold; - padding: 2px; - border-top: 1px solid black; -} + h2 { + background-color: #9B410E; + color: white; + text-align: left; + font-weight: bold; + padding: 2px; + border-top: 1px solid black; + } -body { - background: black; -} + body { + background: black; + } -p, table, div { - background: #f0ead8; -} + p, table, div { + background: #f0ead8; + } -p { - margin: 0; - font-style: italic; - text-align: center; -} + p { + margin: 0; + font-style: italic; + text-align: center; + } -table { - width: 100%; -} + table { + width: 100%; + } -th, td { - font-family: monospace; - vertical-align: top; - text-align: left; - width: 50%; -} + th, td { + font-family: monospace; + vertical-align: top; + text-align: left; + width: 50%; + } -td { - color: green; -} + td { + color: green; + } -.odd { - background-color: #eeeeee; -} + .odd { + background-color: #eeeeee; + } -.even { - background-color: #fafafa; -} + .even { + background-color: #fafafa; + } -.exectime { - font-size: 0.8em; - font-style: italic; -} + .exectime { + font-size: 0.8em; + font-style: italic; + } -#table_assigned_vars th { - color: blue; -} + #table_assigned_vars th { + color: blue; + } -#table_config_vars th { - color: maroon; -} -{/literal} -</style> -</head> -<body> + #table_config_vars th { + color: maroon; + } -<h1>Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1> + {/literal} + </style> + </head> + <body> -{if !empty($template_data)} -<h2>included templates & config files (load time in seconds)</h2> + <h1>Smarty Debug Console + - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1> -<div> -{foreach $template_data as $template} - <font color=brown>{$template.name}</font> - <span class="exectime"> - (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) + {if !empty($template_data)} + <h2>included templates & config files (load time in seconds)</h2> + <div> + {foreach $template_data as $template} + <font color=brown>{$template.name}</font> + <span class="exectime"> + (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"} + ) </span> - <br> -{/foreach} -</div> -{/if} + <br> + {/foreach} + </div> + {/if} -<h2>assigned template variables</h2> + <h2>assigned template variables</h2> -<table id="table_assigned_vars"> - {foreach $assigned_vars as $vars} - <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> - <th>${$vars@key|escape:'html'}</th> - <td>{$vars|debug_print_var nofilter}</td></tr> - {/foreach} -</table> + <table id="table_assigned_vars"> + {foreach $assigned_vars as $vars} + <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> + <th>${$vars@key|escape:'html'}</th> + <td>{$vars|debug_print_var nofilter}</td> + </tr> + {/foreach} + </table> -<h2>assigned config file variables (outer template scope)</h2> + <h2>assigned config file variables (outer template scope)</h2> -<table id="table_config_vars"> - {foreach $config_vars as $vars} - <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> - <th>{$vars@key|escape:'html'}</th> - <td>{$vars|debug_print_var nofilter}</td></tr> - {/foreach} + <table id="table_config_vars"> + {foreach $config_vars as $vars} + <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> + <th>{$vars@key|escape:'html'}</th> + <td>{$vars|debug_print_var nofilter}</td> + </tr> + {/foreach} -</table> -</body> -</html> + </table> + </body> + </html> {/capture} <script type="text/javascript"> -{$id = $template_name|default:''|md5} - _smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes"); + {$id = $template_name|default:''|md5} + _smarty_console = window.open("", "console{$id}", "width=680,height=600,resizable,scrollbars=yes"); _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}"); _smarty_console.document.close(); </script> Modified: trunk/smarty/libs/plugins/block.textformat.php =================================================================== --- trunk/smarty/libs/plugins/block.textformat.php 2014-10-23 18:26:54 UTC (rev 1703) +++ trunk/smarty/libs/plugins/block.textformat.php 2014-10-23 22:23:53 UTC (rev 1704) @@ -2,13 +2,12 @@ /** * Smarty plugin to format text blocks * - * @package Smarty + * @package Smarty * @subpackage PluginsBlock */ /** * Smarty {textformat}{/textformat} block plugin - * * Type: block function<br> * Name: textformat<br> * Purpose: format text a certain way with preset styles @@ -23,12 +22,14 @@ * - wrap_boundary - boolean (true) * </pre> * - * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} - * (Smarty online manual) + * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) + * * @param array $params parameters * @param string $content contents of the block * @param Smarty_Internal_Template $template template object * @param boolean &$repeat repeat flag + * * @return string content re-formatted * @author Monte Ohrt <monte at ohrt dot com> */ @@ -76,7 +77,6 @@ } // split into paragraphs $_paragraphs = preg_split('![\r\n]{2}!', $content); - $_output = ''; foreach ($_... [truncated message content] |