mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
Fix to be able to use $smarty.x variables as arrays.
This commit is contained in:
@@ -1297,38 +1297,48 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
case 'get':
|
case 'get':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$compiled_ref = "\$GLOBALS['HTTP_GET_VARS']";
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_GET_VARS']['$name']";
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'post':
|
case 'post':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_POST_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_POST_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'cookies':
|
case 'cookies':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'env':
|
case 'env':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']";
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']['$name']";
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'server':
|
case 'server':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'session':
|
case 'session':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1297,38 +1297,48 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
case 'get':
|
case 'get':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$compiled_ref = "\$GLOBALS['HTTP_GET_VARS']";
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_GET_VARS']['$name']";
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'post':
|
case 'post':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_POST_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_POST_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'cookies':
|
case 'cookies':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'env':
|
case 'env':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']";
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']['$name']";
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'server':
|
case 'server':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'session':
|
case 'session':
|
||||||
array_shift($indexes);
|
array_shift($indexes);
|
||||||
$name = substr($indexes[0], 1);
|
$name = substr($indexes[0], 1);
|
||||||
$compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']['$name']";
|
$compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']";
|
||||||
|
if ($name = substr($indexes[0], 1))
|
||||||
|
$compiled_ref .= "['$name']";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user