You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-commits@incubator.apache.org by to...@apache.org on 2011/01/23 22:02:17 UTC

[zeta-commits] svn commit: r1062540 - in /incubator/zetacomponents/trunk/Template/src/functions: array_functions.php functions.php

Author: toby
Date: Sun Jan 23 22:02:17 2011
New Revision: 1062540

URL: http://svn.apache.org/viewvc?rev=1062540&view=rev
Log:
- Fixed #ZETACOMP-43: Support internal functions with only optional parameters.
- Fixed: Definition of the array_pad() function.
# This one was incorrect anyway, but through #ZETACOMP-43 this had no effect.

Modified:
    incubator/zetacomponents/trunk/Template/src/functions/array_functions.php
    incubator/zetacomponents/trunk/Template/src/functions/functions.php

Modified: incubator/zetacomponents/trunk/Template/src/functions/array_functions.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Template/src/functions/array_functions.php?rev=1062540&r1=1062539&r2=1062540&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Template/src/functions/array_functions.php (original)
+++ incubator/zetacomponents/trunk/Template/src/functions/array_functions.php Sun Jan 23 22:02:17 2011
@@ -189,7 +189,7 @@ class ezcTemplateArrayFunctions extends 
 
                if ( self::countParameters( $parameters ) == 2 )
                {
-                    return array( ezcTemplateAstNode::TYPE_ARRAY, array( "[%array]", "%length", "%pad" ), 
+                    return array( ezcTemplateAstNode::TYPE_ARRAY, array( "%length", "%pad" ), 
                         self::functionCall( "array_pad", array( self::functionCall( "array", array() ), "%length", "%pad" ) ) );
                }
                else

Modified: incubator/zetacomponents/trunk/Template/src/functions/functions.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Template/src/functions/functions.php?rev=1062540&r1=1062539&r2=1062540&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Template/src/functions/functions.php (original)
+++ incubator/zetacomponents/trunk/Template/src/functions/functions.php Sun Jan 23 22:02:17 2011
@@ -300,7 +300,7 @@ class ezcTemplateFunctions
         $i = 0;
         foreach ( $functionDefinition[ $index ] as $p )
         {
-            if ( self::isOptional( $p ) && $realParameters < $definedParameters)
+            if ( self::isOptional( $p ) && $realParameters < $i )
             {
                 // We should skip this parameter.
                 $parameterMap[$p] = null;