remove undocumented function HiddenFields()
[perl/plp/.git] / PLP / Functions.pm
index ea30488f55a79f280fe6fb2ce552e3b8458c5a9c..fa23270ba7b01439f56e2e11de5d01ad34770655 100644 (file)
@@ -4,7 +4,7 @@ use base 'Exporter';
 use Fcntl qw(:flock);
 use strict;
 
-our @EXPORT = qw/HiddenFields Entity DecodeURI EncodeURI Entity include PLP_END
+our @EXPORT = qw/Entity DecodeURI EncodeURI include PLP_END
                  AddCookie ReadFile WriteFile AutoURL Counter Include exit/;
 
 sub Include ($) {
@@ -32,16 +32,6 @@ sub PLP_END (&) {
     push @PLP::END, shift;
 }
 
-sub HiddenFields ($@) {
-    my $hash = shift;
-    my %saves;
-    @saves{@_} = ();
-    for (keys %$hash) {
-       print qq{<input type=hidden name="$_" value="$hash->{$_}">}
-           unless exists $saves{$_};
-    }
-}
-
 sub Entity (@) {
     my $ref;
     my @copy;    
@@ -253,17 +243,26 @@ In void context, B<changes> the values of the given variables. In other contexts
 
     <: print Entity($user_input); :>
 
+Be warned that this function also HTMLizes consecutive whitespace and newlines (using &nbsp; and <br> respectively).
+For simple escaping, use L<XML::Quote>. To escape high-bit characters as well, use L<HTML::Entities>.
+
 =item EncodeURI LIST
 
-Replaces characters by their %-encoded values.
+Encodes URI strings according to RFC 3986. All disallowed characters are replaced by their %-encoded values.
 
 In void context, B<changes> the values of the given variables. In other contexts, returns the changed versions.
 
     <a href="/foo.plp?name=<:= EncodeURI($name) :>">Link</a>
 
+Note that the following reserved characters are I<not> percent-encoded, even though they may have a special meaning in URIs:
+
+       / ? : @ $
+
+This should be safe for escaping query values (as in the example above), but it may be a better idea to use L<URI::Escape> instead.
+
 =item DecodeURI LIST
 
-Decodes %-encoded strings.
+Decodes %-encoded strings. Unlike L<URI::Escape>, it also translates + characters to spaces (as browsers use those).
 
 In void context, B<changes> the values of the given variables. In other contexts, returns the changed versions.
 
@@ -299,5 +298,7 @@ Adds a Set-Cookie header. STRING must be a valid Set-Cookie header value.
 
 Juerd Waalboer <juerd@cpan.org>
 
+Current maintainer: Mischa POSLAWSKY <shiar@cpan.org>
+
 =cut