[interchange-cvs] interchange - kwalsh modified code/SystemTag/either.coretag

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sun Mar 11 10:44:39 EST 2007


User:      kwalsh
Date:      2007-03-11 15:44:39 GMT
Modified:  code/SystemTag either.coretag
Log:
    * Slight behaviour change:  Previously, if none of the parts (split
      on [or]) were found to be true then an undef value would be returned.
      Now, if none of the parts are found to be true then the last part
      seen will be returned.

      This change allows the following to return "0" instead of "" if the
      "expected_number" scratchpad value is zero or blank:

	[either][scratch expected_number][or]0[/either]

Revision  Changes    Path
1.5       +6 -5      interchange/code/SystemTag/either.coretag


rev 1.5, prev_rev 1.4
Index: either.coretag
===================================================================
RCS file: /var/cvs/interchange/code/SystemTag/either.coretag,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- either.coretag	24 Mar 2006 19:30:11 -0000	1.4
+++ either.coretag	11 Mar 2007 15:44:38 -0000	1.5
@@ -1,21 +1,22 @@
 # Copyright 2002-2005 Interchange Development Group (http://www.icdevgroup.org/)
 # Licensed under the GNU GPL v2. See file LICENSE for details.
-# $Id: either.coretag,v 1.4 2006/03/24 19:30:11 kwalsh Exp $
+# $Id: either.coretag,v 1.5 2007/03/11 15:44:38 kwalsh Exp $
 
 UserTag either              hasEndTag
 UserTag either              PosNumber    0
 UserTag either              NoReparse    1
-UserTag either              Version      $Revision: 1.4 $
+UserTag either              Version      $Revision: 1.5 $
 UserTag either              Routine      <<EOR
 sub {
 	my @ary = split /\[or\]/, shift;
 	my $result;
-	while(@ary) {
-		$result = interpolate_html(shift @ary);
+
+	foreach (@ary) {
+		$result = interpolate_html($_);
 		$result =~ s/^\s+//;
 		$result =~ s/\s+$//;
 		return $result if $result;
 	}
-	return;
+	return $result;
 }
 EOR








More information about the interchange-cvs mailing list