Author: kn
Date: Mon Jan  7 11:40:51 2008
New Revision: 7085

Log:
- Fixed issue #12289: String function str_last_index documented, but not
  defined.

Modified:
    trunk/Template/ChangeLog
    trunk/Template/docs/functions/string.txt
    trunk/Template/src/functions/string_functions.php
    trunk/Template/tests/regression_tests/functions/correct/string_functions.in
    trunk/Template/tests/regression_tests/functions/correct/string_functions.out

Modified: trunk/Template/ChangeLog
==============================================================================
--- trunk/Template/ChangeLog [iso-8859-1] (original)
+++ trunk/Template/ChangeLog [iso-8859-1] Mon Jan  7 11:40:51 2008
@@ -6,6 +6,8 @@
 - Fixed issue #11228: Cannot supply an absolute Win32-Path to $t->process().
 - Better error message when an external (use) variable is not given.
 - Made named parameters work with PHP 5.1.6.
+- Fixed issue #12289: String function str_last_index documented, but not
+  defined.
 
 
 1.2 - Monday 02 July 2007

Modified: trunk/Template/docs/functions/string.txt
==============================================================================
--- trunk/Template/docs/functions/string.txt [iso-8859-1] (original)
+++ trunk/Template/docs/functions/string.txt [iso-8859-1] Mon Jan  7 11:40:51 
2008
@@ -299,13 +299,13 @@
 
     {str_last_index( "Don't you dare use the word 'party' as a verb in this 
shop!", "party" )}
     {str_last_index( "Don't you dare use the word 'party' as a verb in this 
shop!", "a" )}
-    {str_last_index( "Don't you dare use the word 'party' as a verb in this 
shop!", "a", 38 )}
+    {str_last_index( "Don't you dare use the word 'party' as a verb in this 
shop!", "a", -25 )}
 
 Outputs::
 
     29
     39
-    36
+    30
 
 See also str_index_of_ (), str_contains_ (), str_starts_with_ (), 
str_ends_with_ ().
 

Modified: trunk/Template/src/functions/string_functions.php
==============================================================================
--- trunk/Template/src/functions/string_functions.php [iso-8859-1] (original)
+++ trunk/Template/src/functions/string_functions.php [iso-8859-1] Mon Jan  7 
11:40:51 2008
@@ -150,8 +150,8 @@
             
             // str_last_index( $sl, $sr [, $index] )
             // strrpos( $sl, $sr [, $index ] )
-            case "str_index_of": return array( ezcTemplateAstNode::TYPE_VALUE, 
array( "%haystack", "%needle", "[%index]" ), 
-                self::functionCall( "strpos", array( "%haystack", "%needle", 
"[%index]" ) ) );
+            case "str_last_index": return array( 
ezcTemplateAstNode::TYPE_VALUE, array( "%haystack", "%needle", "[%index]" ), 
+                self::functionCall( "strrpos", array( "%haystack", "%needle", 
"[%index]" ) ) );
              
             // str_is_empty( $s )
             // strlen( $s ) === 0

Modified: 
trunk/Template/tests/regression_tests/functions/correct/string_functions.in
==============================================================================
--- trunk/Template/tests/regression_tests/functions/correct/string_functions.in 
[iso-8859-1] (original)
+++ trunk/Template/tests/regression_tests/functions/correct/string_functions.in 
[iso-8859-1] Mon Jan  7 11:40:51 2008
@@ -17,6 +17,7 @@
 16. {str_at( "abcdefg", 1)}
 17. {str_fill( "ab", 3)}
 18. {str_index_of( "abcdefgcdab", "def")} {str_index_of( "abcdefgcdab", "cd", 
5 ) }
+18.2. {str_last_index( "abcdefgcdab", "ab")} {str_last_index( "abcdefgcdab", 
"ab", -5 ) }
 19. {str_is_empty( "" )} {str_is_empty("") !== false}
 20. {str_pad_left( "abc", 5, ".." )}
 

Modified: 
trunk/Template/tests/regression_tests/functions/correct/string_functions.out
==============================================================================
--- 
trunk/Template/tests/regression_tests/functions/correct/string_functions.out 
[iso-8859-1] (original)
+++ 
trunk/Template/tests/regression_tests/functions/correct/string_functions.out 
[iso-8859-1] Mon Jan  7 11:40:51 2008
@@ -17,6 +17,7 @@
 16. b
 17. ababab
 18. 3 7
+18.2. 9 0
 19. 1 1
 20. ..abc
 


-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to