mirror of
https://github.com/smarty-php/smarty.git
synced 2026-08-06 21:44:17 +02:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad3e64b890 | |||
| 8bcad8125a | |||
| de8354e152 | |||
| 9e6dddeee4 | |||
| fc60543d80 | |||
| d88df01d7d | |||
| 443e36f1a8 | |||
| c1bf89849b | |||
| 4014a41c02 | |||
| 3bdad9eaeb | |||
| 42696fcc21 | |||
| 8189261d68 | |||
| 49e154a6f9 | |||
| 2172df777a | |||
| 25be1792e6 |
@@ -1,3 +1,14 @@
|
||||
- revert super global access changes, and instead rely on
|
||||
USE_SUPER_GLOBALS for security
|
||||
|
||||
Version 2.6.25 (May 19th, 2009)
|
||||
-------------------------------
|
||||
- fix E_NOTICE when sessions are disabled (mohrt)
|
||||
|
||||
Version 2.6.24 (May 16th, 2009)
|
||||
-------------------------------
|
||||
- fix problem introduced with super global changes (mohrt)
|
||||
|
||||
Version 2.6.23 (May 13th, 2009)
|
||||
-------------------------------
|
||||
- strip backticks from {math} equations (mohrt)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* smarty-discussion-subscribe@googlegroups.com
|
||||
*
|
||||
* @link http://www.smarty.net/
|
||||
* @version 2.6.24-dev
|
||||
* @version 2.6.25-dev
|
||||
* @copyright Copyright: 2001-2005 New Digital Group, Inc.
|
||||
* @author Andrei Zmievski <andrei@php.net>
|
||||
* @access public
|
||||
|
||||
+3
-20
@@ -27,7 +27,7 @@
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @author Andrei Zmievski <andrei@php.net>
|
||||
* @package Smarty
|
||||
* @version 2.6.24-dev
|
||||
* @version 2.6.25-dev
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -107,7 +107,7 @@ class Smarty
|
||||
/**
|
||||
* When set, smarty does uses this value as error_reporting-level.
|
||||
*
|
||||
* @var boolean
|
||||
* @var integer
|
||||
*/
|
||||
var $error_reporting = null;
|
||||
|
||||
@@ -465,7 +465,7 @@ class Smarty
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $_version = '2.6.24-dev';
|
||||
var $_version = '2.6.25-dev';
|
||||
|
||||
/**
|
||||
* current template inclusion depth
|
||||
@@ -562,14 +562,6 @@ class Smarty
|
||||
*/
|
||||
var $_cache_including = false;
|
||||
|
||||
/**
|
||||
* array of super globals internally
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $_supers = array();
|
||||
|
||||
|
||||
/**#@-*/
|
||||
/**
|
||||
* The class constructor.
|
||||
@@ -578,15 +570,6 @@ class Smarty
|
||||
{
|
||||
$this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
|
||||
: @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
|
||||
|
||||
$this->_supers['get'] = $this->request_use_auto_globals ? $_GET : $GLOBALS['HTTP_GET_VARS'];
|
||||
$this->_supers['post'] = $this->request_use_auto_globals ? $_POST : $GLOBALS['HTTP_POST_VARS'];
|
||||
$this->_supers['server'] = $this->request_use_auto_globals ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
|
||||
$this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS'];
|
||||
$this->_supers['request'] = $this->request_use_auto_globals ? $_REQUEST : $GLOBALS['HTTP_REQUEST_VARS'];
|
||||
$this->_supers['cookies'] = $this->request_use_auto_globals ? $_COOKIE : $GLOBALS['HTTP_COOKIE_VARS'];
|
||||
$this->_supers['env'] = $this->request_use_auto_globals ? $_ENV : $GLOBALS['HTTP_ENV_VARS'];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* @link http://smarty.php.net/
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @author Andrei Zmievski <andrei@php.net>
|
||||
* @version 2.6.24-dev
|
||||
* @version 2.6.25-dev
|
||||
* @copyright 2001-2005 New Digital Group, Inc.
|
||||
* @package Smarty
|
||||
*/
|
||||
@@ -2047,27 +2047,57 @@ class Smarty_Compiler extends Smarty {
|
||||
break;
|
||||
|
||||
case 'get':
|
||||
$compiled_ref = "\$this->_supers['get']";
|
||||
if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
|
||||
$this->_syntax_error("(secure mode) super global access not permitted",
|
||||
E_USER_WARNING, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
$compiled_ref = "\$_GET";
|
||||
break;
|
||||
|
||||
case 'post':
|
||||
$compiled_ref = "\$this->_supers['post']";
|
||||
if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
|
||||
$this->_syntax_error("(secure mode) super global access not permitted",
|
||||
E_USER_WARNING, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
$compiled_ref = "\$_POST";
|
||||
break;
|
||||
|
||||
case 'cookies':
|
||||
$compiled_ref = "\$this->_supers['cookies']";
|
||||
if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
|
||||
$this->_syntax_error("(secure mode) super global access not permitted",
|
||||
E_USER_WARNING, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
$compiled_ref = "\$_COOKIE";
|
||||
break;
|
||||
|
||||
case 'env':
|
||||
$compiled_ref = "\$this->_supers['env']";
|
||||
if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
|
||||
$this->_syntax_error("(secure mode) super global access not permitted",
|
||||
E_USER_WARNING, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
$compiled_ref = "\$_ENV";
|
||||
break;
|
||||
|
||||
case 'server':
|
||||
$compiled_ref = "\$this->_supers['server']";
|
||||
if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
|
||||
$this->_syntax_error("(secure mode) super global access not permitted",
|
||||
E_USER_WARNING, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
$compiled_ref = "\$_SERVER";
|
||||
break;
|
||||
|
||||
case 'session':
|
||||
$compiled_ref = "\$this->_supers['session']";
|
||||
if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
|
||||
$this->_syntax_error("(secure mode) super global access not permitted",
|
||||
E_USER_WARNING, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
$compiled_ref = "\$_SESSION";
|
||||
break;
|
||||
|
||||
/*
|
||||
@@ -2075,8 +2105,13 @@ class Smarty_Compiler extends Smarty {
|
||||
* compiler.
|
||||
*/
|
||||
case 'request':
|
||||
if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
|
||||
$this->_syntax_error("(secure mode) super global access not permitted",
|
||||
E_USER_WARNING, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
if ($this->request_use_auto_globals) {
|
||||
$compiled_ref = "\$this->_supers['request']";
|
||||
$compiled_ref = "\$_REQUEST";
|
||||
break;
|
||||
} else {
|
||||
$this->_init_smarty_vars = true;
|
||||
|
||||
Reference in New Issue
Block a user