Details
-
Bug
-
Resolution: Fixed
-
Medium
-
3.8.8, 3.9.2
-
None
Description
1. There is an inconsistency:
'compare' compares the contents of two arrays or strings
but two different strings '0.3' and '0.30' are equal
and arrays of these strings are equal as well in some cases and are not equal in other cases
2. 'eq' operator works correctly and should always return true for these cases (in exemple), we think we should not change this behaviour.
Steps to reproduce
For example:
{def $var1='0.3' $var2='0.30'} compare( {$var1}, {$var2} ): {$var1|compare( $var2 )}<br> compare( '0.3', '0.30' ): {'0.3'|compare( '0.30' )}<br> compare( array( {$var1} ), array( {$var2} ) ): {array( $var1 )|compare( array( $var2 ) )}<br> compare( array( '0.3' ), array( '0.30' ) ): {array( '0.3' )|compare( array( '0.30' ) )}<br>
if template compilation is disabled
it will produce:
compare( 0.3, 0.30 ): 1 compare( '0.3', '0.30' ): 1 compare( array( 0.3 ), array( 0.30 ) ): compare( array( '0.3' ), array( '0.30' ) ):
but if template compilation is enabled
it will produce
compare( 0.3, 0.30 ): 1 compare( '0.3', '0.30' ): 1 compare( array( 0.3 ), array( 0.30 ) ): 1 compare( array( '0.3' ), array( '0.30' ) ): 1
'compare' operator should return false for all these cases but it doesn't.
Attachments
Issue Links
- relates to
-
EZP-8942 template operator ne takes 0,xxx as 0
- Closed