Details
-
Bug
-
Resolution: Obsolete
-
Medium
-
4.0.1
-
None
-
Operating System: Linux
PHP Version: 5.2.4
Database and version: MySQL 5.0
Description
When using extract_right(0) to extract a value from an array the operator returns an empty array (correct) when TemplateCompile is disabled but returns one value from the input array (wrong) when TemplateCompile is enabled.
Steps to reproduce
Set site.ini to:
[TemplateSettings]
TemplateCompile=disabled
Insert the following code into a template:
{def $array = array(1)} {def $array_part_right = $array|extract_right(0)} {$array|attribute(show,1)} {$array_part_right|attribute(show,1)}
Load the page.
Result:
Output of 2 arrays, one with value 1, one with no values.
Now set
TemplateCompile=enabled
Result:
Output of 2 arrays, both with value 1.
This is wrong as extracting 0 values from an array should result in an empty array.
Attachments
Issue Links
- is duplicated by
-
EZP-15013 extract_right not working with negative length and disabled TemplateCompile
- Closed