[interchange-cvs] interchange - heins modified lib/Vend/Util.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Tue Jun 11 15:12:00 2002


User:      heins
Date:      2002-06-11 19:11:30 GMT
Modified:  lib/Vend Util.pm
Log:
	* Consolidate duplicate routines
	* Add full CGI unescape ability

Revision  Changes    Path
2.25      +11 -11    interchange/lib/Vend/Util.pm


rev 2.25, prev_rev 2.24
Index: Util.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Util.pm,v
retrieving revision 2.24
retrieving revision 2.25
diff -u -r2.24 -r2.25
--- Util.pm	2 May 2002 00:32:07 -0000	2.24
+++ Util.pm	11 Jun 2002 19:11:30 -0000	2.25
@@ -1,6 +1,6 @@
 # Vend::Util - Interchange utility functions
 #
-# $Id: Util.pm,v 2.24 2002/05/02 00:32:07 jon Exp $
+# $Id: Util.pm,v 2.25 2002/06/11 19:11:30 mheins Exp $
 # 
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -82,7 +82,7 @@
 use Safe;
 use subs qw(logError logGlobal);
 use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 2.24 $, 10);
+$VERSION = substr(q$Revision: 2.25 $, 10);
 
 BEGIN {
 	eval {
@@ -542,6 +542,15 @@
     return $s;
 }
 
+*unescape_chars = \&unhexify;
+
+sub unescape_full {
+    my $url = shift;
+    $url =~ tr/+/ /;
+    $url =~ s/<!--.*?-->//sg;
+    return unhexify($url);
+}
+
 ## UNEVAL
 
 # Returns a string representation of an anonymous array, hash, or scaler
@@ -1641,15 +1650,6 @@
 
 	# Authorized if got here
 	return 1;
-}
-
-# Replace the escape notation %HH with the actual characters.
-#
-sub unescape_chars {
-    my($in) = @_;
-
-    $in =~ s/%(..)/chr(hex($1))/ge;
-    $in;
 }