Compare commits

...

16 Commits

Author SHA1 Message Date
Uwe Tews 47fa66cdcf Release 2.6.29 2015-06-21 15:10:14 +02:00
Uwe Tews e97b7d136c * PHP7 raises E_DEPRECATED use __construct for compatibility 2015-06-21 15:00:26 +02:00
Uwe Tews 0ecdd6c41d Merge branch 'v2.6.28' 2014-10-31 01:07:20 +01:00
Uwe Tews a4ff415bfa delete unneeded 2014-10-31 01:06:18 +01:00
Uwe Tews 9a36601dad Merge branch 'v2.6.27' 2014-10-31 01:03:22 +01:00
Uwe Tews 1594e08924 delete unneeded 2014-10-31 01:02:41 +01:00
Uwe.Tews@googlemail.com 4129665748 Fixed old vulnerability bug https://bugs.gentoo.org/show_bug.cgi?id=356615 2013-09-30 19:14:32 +00:00
Uwe.Tews@googlemail.com bbe4890b89 * Fixed made Smarty_Compiler.class.php compatible with PHP 5.5 2013-07-16 19:46:59 +00:00
uwe.tews@googlemail.com b67c7082a7 - escape Smarty error messages to avoid possible script execution 2012-09-24 20:05:15 +00:00
monte.ohrt 7dc58993ad move smarty 2 trunk to branch area 2010-11-12 01:26:25 +00:00
matakagi a2e69a04e7 sync with en. 2010-07-29 08:47:24 +00:00
Uwe.Tews abf692eaf7 - fixed security hole in {math} plugin 2010-04-17 10:19:47 +00:00
Uwe.Tews 7d42f5efb9 - bugfix cycle plugin 2009-11-17 20:20:17 +00:00
monte.ohrt 5d2ed61c31 Revert delimiter code change 2009-11-17 01:29:01 +00:00
monte.ohrt 29fefe388c add outputfilters to see also list 2009-08-18 16:25:07 +00:00
monte.ohrt 243531e4a3 change split() to preg_split(), deprecated in php 5.3 2009-07-05 04:58:48 +00:00
7 changed files with 48 additions and 21 deletions
+22
View File
@@ -1,3 +1,25 @@
2015-06-21 Uwe Tews
* PHP7 raises E_DEPRECATED use __construct for compatibility
2013-09-30
* Fixed old vulnerability bug https://bugs.gentoo.org/show_bug.cgi?id=356615
2013-07-16 Uwe Tews
* Fixed made Smarty_Compiler.class.php compatible with PHP 5.5
2012-09-24 Uwe Tews
* Fixed escape Smarty error messages to avoid possible script execution
2010-04-17 Uwe Tews
* Fixed security hole in {math} plugin
2007-09-27 TAKAGI Masahiro <matakagi@gmail.com>
* docs/ja/designers/language-custom-functions/language-function-html-checkboxes.xml:
+1 -1
View File
@@ -73,7 +73,7 @@ class Config_File {
*
* @param string $config_path (optional) path to the config files
*/
function Config_File($config_path = NULL)
public function __construct($config_path = NULL)
{
if (isset($config_path))
$this->set_path($config_path);
+11 -10
View File
@@ -20,14 +20,14 @@
*
* For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to
* smarty-discussion-subscribe@googlegroups.com
* smarty-discussion-subscribe@googlegroups.com
*
* @link http://www.smarty.net/
* @copyright 2001-2005 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com>
* @author Andrei Zmievski <andrei@php.net>
* @package Smarty
* @version 2.6.25-dev
* @version 2.6.29
*/
/* $Id$ */
@@ -465,7 +465,7 @@ class Smarty
*
* @var string
*/
var $_version = '2.6.25-dev';
var $_version = '2.6.29';
/**
* current template inclusion depth
@@ -566,7 +566,7 @@ class Smarty
/**
* The class constructor.
*/
function Smarty()
public function __construct()
{
$this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
: @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
@@ -1058,7 +1058,7 @@ class Smarty
} else {
// var non-existant, return valid reference
$_tmp = null;
return $_tmp;
return $_tmp;
}
}
@@ -1090,7 +1090,8 @@ class Smarty
*/
function trigger_error($error_msg, $error_type = E_USER_WARNING)
{
trigger_error("Smarty error: $error_msg", $error_type);
$msg = htmlentities($error_msg);
trigger_error("Smarty error: $msg", $error_type);
}
@@ -1117,7 +1118,7 @@ class Smarty
function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)
{
static $_cache_info = array();
$_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
? $this->error_reporting : error_reporting() & ~E_NOTICE);
@@ -1933,10 +1934,10 @@ class Smarty
{
return eval($code);
}
/**
* Extracts the filter name from the given callback
*
*
* @param callback $function
* @return string
*/
@@ -1951,7 +1952,7 @@ class Smarty
return $function;
}
}
/**#@-*/
}
+5 -5
View File
@@ -78,7 +78,7 @@ class Smarty_Compiler extends Smarty {
/**
* The class constructor.
*/
function Smarty_Compiler()
public function __construct()
{
// matches double quoted strings:
// "foobar"
@@ -262,11 +262,11 @@ class Smarty_Compiler extends Smarty {
reset($this->_folded_blocks);
/* replace special blocks by "{php}" */
$source_content = preg_replace($search.'e', "'"
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "'"
. "';")
, $source_content);
/* Gather all template tags. */
@@ -2122,7 +2122,7 @@ class Smarty_Compiler extends Smarty {
return null;
case 'template':
$compiled_ref = "'$this->_current_file'";
$compiled_ref = "'" . addslashes($this->_current_file) . "'";
$_max_index = 1;
break;
+5 -1
View File
@@ -63,7 +63,11 @@ function smarty_function_cycle($params, &$smarty)
$cycle_vars[$name]['values'] = $params['values'];
}
$cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ',';
if (isset($params['delimiter'])) {
$cycle_vars[$name]['delimiter'] = $params['delimiter'];
} elseif (!isset($cycle_vars[$name]['delimiter'])) {
$cycle_vars[$name]['delimiter'] = ',';
}
if(is_array($cycle_vars[$name]['values'])) {
$cycle_array = $cycle_vars[$name]['values'];
+2 -2
View File
@@ -181,12 +181,12 @@ function smarty_function_fetch($params, &$smarty)
$content .= fgets($fp,4096);
}
fclose($fp);
$csplit = split("\r\n\r\n",$content,2);
$csplit = preg_split("!\r\n\r\n!",$content,2);
$content = $csplit[1];
if(!empty($params['assign_headers'])) {
$smarty->assign($params['assign_headers'],split("\r\n",$csplit[0]));
$smarty->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0]));
}
}
} else {
+2 -2
View File
@@ -37,7 +37,7 @@ function smarty_function_math($params, &$smarty)
}
// match all vars in equation, make sure all are passed
preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match);
$allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
@@ -82,4 +82,4 @@ function smarty_function_math($params, &$smarty)
/* vim: set expandtab: */
?>
?>