mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
Negative values of 'max' will mean no max.
This commit is contained in:
@@ -436,9 +436,6 @@ class Smarty_Compiler extends Smarty {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'max':
|
case 'max':
|
||||||
$output .= "{$section_props}['$attr_name'] = max(0, (int)$attr_value);\n";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'start':
|
case 'start':
|
||||||
$output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
|
$output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
|
||||||
break;
|
break;
|
||||||
@@ -454,6 +451,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
if (!isset($attrs['max']))
|
if (!isset($attrs['max']))
|
||||||
$output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
|
$output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
|
||||||
|
else
|
||||||
|
$output .= "if ({$section_props}['max'] < 0)\n" .
|
||||||
|
" {$section_props}['max'] = {$section_props}['loop'];\n";
|
||||||
|
|
||||||
if (!isset($attrs['start']))
|
if (!isset($attrs['start']))
|
||||||
$output .= "{$section_props}['start'] = 0;\n";
|
$output .= "{$section_props}['start'] = 0;\n";
|
||||||
|
@@ -436,9 +436,6 @@ class Smarty_Compiler extends Smarty {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'max':
|
case 'max':
|
||||||
$output .= "{$section_props}['$attr_name'] = max(0, (int)$attr_value);\n";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'start':
|
case 'start':
|
||||||
$output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
|
$output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
|
||||||
break;
|
break;
|
||||||
@@ -454,6 +451,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
if (!isset($attrs['max']))
|
if (!isset($attrs['max']))
|
||||||
$output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
|
$output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
|
||||||
|
else
|
||||||
|
$output .= "if ({$section_props}['max'] < 0)\n" .
|
||||||
|
" {$section_props}['max'] = {$section_props}['loop'];\n";
|
||||||
|
|
||||||
if (!isset($attrs['start']))
|
if (!isset($attrs['start']))
|
||||||
$output .= "{$section_props}['start'] = 0;\n";
|
$output .= "{$section_props}['start'] = 0;\n";
|
||||||
|
Reference in New Issue
Block a user