mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
Fixed a few E_NOTICE warnings.
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,3 +1,4 @@
|
|||||||
|
- fixed indexing by section properties with the new syntax. (Andrei)
|
||||||
- fix LOCK_EX logic once and for all (not used under windows) (Monte)
|
- fix LOCK_EX logic once and for all (not used under windows) (Monte)
|
||||||
- updated Smarty to use absolute paths when requiring/including Smarty
|
- updated Smarty to use absolute paths when requiring/including Smarty
|
||||||
components. (Andrei, John Lim)
|
components. (Andrei, John Lim)
|
||||||
@@ -6,7 +7,6 @@ Version 1.4.0
|
|||||||
-------------
|
-------------
|
||||||
- added {capture}{/capture} function, documented (Monte)
|
- added {capture}{/capture} function, documented (Monte)
|
||||||
- added {counter} function, documented (Monte)
|
- added {counter} function, documented (Monte)
|
||||||
- fixed indexing by section properties with the new syntax. (Andrei)
|
|
||||||
|
|
||||||
Version 1.4.0b2
|
Version 1.4.0b2
|
||||||
---------------
|
---------------
|
||||||
|
@@ -171,7 +171,8 @@ class Smarty_Compiler extends Smarty {
|
|||||||
)
|
)
|
||||||
(?:\s+(.*))?
|
(?:\s+(.*))?
|
||||||
/xs', $template_tag, $match);
|
/xs', $template_tag, $match);
|
||||||
list(, $tag_command, $tag_args) = $match;
|
$tag_command = $match[1];
|
||||||
|
$tag_args = isset($match[2]) ? $match[2] : '';
|
||||||
|
|
||||||
/* If the tag name matches a variable or section property definition,
|
/* If the tag name matches a variable or section property definition,
|
||||||
we simply process it. */
|
we simply process it. */
|
||||||
@@ -722,7 +723,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _parse_var($var_expr)
|
function _parse_var($var_expr)
|
||||||
{
|
{
|
||||||
list($var_ref, $modifiers) = explode('|', substr($var_expr, 1), 2);
|
$parts = explode('|', substr($var_expr, 1), 2);
|
||||||
|
$var_ref = $parts[0];
|
||||||
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
preg_match_all('!\[\w+(\.\w+)?\]|(->|\.)\w+|^\w+!', $var_ref, $match);
|
preg_match_all('!\[\w+(\.\w+)?\]|(->|\.)\w+|^\w+!', $var_ref, $match);
|
||||||
$indexes = $match[0];
|
$indexes = $match[0];
|
||||||
@@ -732,9 +735,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
foreach ($indexes as $index) {
|
foreach ($indexes as $index) {
|
||||||
if ($index{0} == '[') {
|
if ($index{0} == '[') {
|
||||||
list($section, $section_prop) = explode('.', substr($index, 1, -1));
|
$parts = explode('.', substr($index, 1, -1));
|
||||||
if (!isset($section_prop))
|
$section = $parts[0];
|
||||||
$section_prop = 'index';
|
$section_prop = isset($parts[1]) ? $parts[1] : 'index';
|
||||||
$output .= "[\$_smarty_sections['$section']['properties']['$section_prop']]";
|
$output .= "[\$_smarty_sections['$section']['properties']['$section_prop']]";
|
||||||
} else if ($index{0} == '.') {
|
} else if ($index{0} == '.') {
|
||||||
$output .= "['" . substr($index, 1) . "']";
|
$output .= "['" . substr($index, 1) . "']";
|
||||||
@@ -754,7 +757,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _parse_conf_var($conf_var_expr)
|
function _parse_conf_var($conf_var_expr)
|
||||||
{
|
{
|
||||||
list($var_ref, $modifiers) = explode('|', $conf_var_expr, 2);
|
$parts = explode('|', $conf_var_expr, 2);
|
||||||
|
$var_ref = $parts[0];
|
||||||
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
$var_name = substr($var_ref, 1, -1);
|
$var_name = substr($var_ref, 1, -1);
|
||||||
|
|
||||||
@@ -771,7 +776,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _parse_section_prop($section_prop_expr)
|
function _parse_section_prop($section_prop_expr)
|
||||||
{
|
{
|
||||||
list($var_ref, $modifiers) = explode('|', $section_prop_expr, 2);
|
$parts = explode('|', $section_prop_expr, 2);
|
||||||
|
$var_ref = $parts[0];
|
||||||
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match);
|
preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match);
|
||||||
$section_name = $match[1];
|
$section_name = $match[1];
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
require("Smarty.class.php");
|
require("Smarty.class.php");
|
||||||
|
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
require("Smarty.class.php");
|
require("Smarty.class.php");
|
||||||
|
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
|
@@ -171,7 +171,8 @@ class Smarty_Compiler extends Smarty {
|
|||||||
)
|
)
|
||||||
(?:\s+(.*))?
|
(?:\s+(.*))?
|
||||||
/xs', $template_tag, $match);
|
/xs', $template_tag, $match);
|
||||||
list(, $tag_command, $tag_args) = $match;
|
$tag_command = $match[1];
|
||||||
|
$tag_args = isset($match[2]) ? $match[2] : '';
|
||||||
|
|
||||||
/* If the tag name matches a variable or section property definition,
|
/* If the tag name matches a variable or section property definition,
|
||||||
we simply process it. */
|
we simply process it. */
|
||||||
@@ -722,7 +723,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _parse_var($var_expr)
|
function _parse_var($var_expr)
|
||||||
{
|
{
|
||||||
list($var_ref, $modifiers) = explode('|', substr($var_expr, 1), 2);
|
$parts = explode('|', substr($var_expr, 1), 2);
|
||||||
|
$var_ref = $parts[0];
|
||||||
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
preg_match_all('!\[\w+(\.\w+)?\]|(->|\.)\w+|^\w+!', $var_ref, $match);
|
preg_match_all('!\[\w+(\.\w+)?\]|(->|\.)\w+|^\w+!', $var_ref, $match);
|
||||||
$indexes = $match[0];
|
$indexes = $match[0];
|
||||||
@@ -732,9 +735,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
foreach ($indexes as $index) {
|
foreach ($indexes as $index) {
|
||||||
if ($index{0} == '[') {
|
if ($index{0} == '[') {
|
||||||
list($section, $section_prop) = explode('.', substr($index, 1, -1));
|
$parts = explode('.', substr($index, 1, -1));
|
||||||
if (!isset($section_prop))
|
$section = $parts[0];
|
||||||
$section_prop = 'index';
|
$section_prop = isset($parts[1]) ? $parts[1] : 'index';
|
||||||
$output .= "[\$_smarty_sections['$section']['properties']['$section_prop']]";
|
$output .= "[\$_smarty_sections['$section']['properties']['$section_prop']]";
|
||||||
} else if ($index{0} == '.') {
|
} else if ($index{0} == '.') {
|
||||||
$output .= "['" . substr($index, 1) . "']";
|
$output .= "['" . substr($index, 1) . "']";
|
||||||
@@ -754,7 +757,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _parse_conf_var($conf_var_expr)
|
function _parse_conf_var($conf_var_expr)
|
||||||
{
|
{
|
||||||
list($var_ref, $modifiers) = explode('|', $conf_var_expr, 2);
|
$parts = explode('|', $conf_var_expr, 2);
|
||||||
|
$var_ref = $parts[0];
|
||||||
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
$var_name = substr($var_ref, 1, -1);
|
$var_name = substr($var_ref, 1, -1);
|
||||||
|
|
||||||
@@ -771,7 +776,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _parse_section_prop($section_prop_expr)
|
function _parse_section_prop($section_prop_expr)
|
||||||
{
|
{
|
||||||
list($var_ref, $modifiers) = explode('|', $section_prop_expr, 2);
|
$parts = explode('|', $section_prop_expr, 2);
|
||||||
|
$var_ref = $parts[0];
|
||||||
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match);
|
preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match);
|
||||||
$section_name = $match[1];
|
$section_name = $match[1];
|
||||||
|
Reference in New Issue
Block a user