[Jifty-commit] r856 - in jifty/trunk: lib/Jifty lib/Jifty/Web/Form

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Apr 13 02:47:04 EDT 2006


Author: alexmv
Date: Thu Apr 13 02:47:03 2006
New Revision: 856

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web.pm
   jifty/trunk/lib/Jifty/Web/Form/Link.pm

Log:
 r12332 at zoq-fot-pik:  chmrr | 2006-04-13 02:46:49 -0400
  * Unite escaping functions


Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Thu Apr 13 02:47:03 2006
@@ -766,7 +766,7 @@
     my @params;
     while ( ( my $key, my $value ) = each %args ) {
         push @params,
-            $key . "=" . $self->mason->interp->apply_escapes( $value, 'u' );
+            $key . "=" . $self->escape_uri( $value );
     }
     return ( join( ';', @params ) );
 }
@@ -779,7 +779,18 @@
 
 sub escape {
     my $self = shift;
-    return join '', map {$self->mason->interp->apply_escapes( $_, 'h' )} @_;
+    return join '', map {Jifty::View::Mason::Handler::escape_utf8( \$_ ); $_} @_;
+}
+
+=head3 escape_uri STRING
+
+URI-escapes the given string and returns it
+
+=cut
+
+sub escape_uri {
+    my $self = shift;
+    return join '', map {Jifty::View::Mason::Handler::escape_uri( \$_ ); $_} @_;
 }
 
 =head3 navigation

Modified: jifty/trunk/lib/Jifty/Web/Form/Link.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Link.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Link.pm	Thu Apr 13 02:47:03 2006
@@ -91,11 +91,11 @@
     my $self = shift;
 
     my $label = $self->label;
-    $label = Jifty->web->mason->interp->apply_escapes( $label, 'h' )
+    $label = Jifty->web->escape( $label )
         if ( $self->escape_label );
 
     my $tooltip = $self->tooltip;
-    $tooltip = Jifty->web->mason->interp->apply_escapes( $tooltip, 'h' )
+    $tooltip = Jifty->web->escape( $tooltip )
         if ( $tooltip and $self->escape_label );
 
     Jifty->web->out(qq(<a));


More information about the Jifty-commit mailing list