git.shiar.nl
/
perl
/
plp
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix missinginclude tests
[perl/plp/.git]
/
lib
/
PLP
/
Functions.pm
diff --git
a/lib/PLP/Functions.pm
b/lib/PLP/Functions.pm
index 18318ad7b0bacbdf643f0037fee5f202abb84ea2..8c3886f795aa44ebf133ce5158a3eeae377d177b 100644
(file)
--- a/
lib/PLP/Functions.pm
+++ b/
lib/PLP/Functions.pm
@@
-3,9
+3,10
@@
package PLP::Functions;
use strict;
use warnings;
use strict;
use warnings;
-use
Exporter qw(import)
;
+use
base 'Exporter'
;
use Fcntl qw(:flock);
use Fcntl qw(:flock);
+our $VERSION = '1.00';
our @EXPORT = qw/Entity DecodeURI EncodeURI Include include PLP_END
AddCookie ReadFile WriteFile AutoURL Counter exit/;
our @EXPORT = qw/Entity DecodeURI EncodeURI Include include PLP_END
AddCookie ReadFile WriteFile AutoURL Counter exit/;
@@
-15,7
+16,7
@@
sub Include ($) {
$PLP::inA = 0;
$PLP::inB = 0;
local $@;
$PLP::inA = 0;
$PLP::inB = 0;
local $@;
- eval 'package PLP::Script; ' . PLP::source($PLP::file, 0, join ' ', (caller)[2,1]);
+ eval 'package PLP::Script;
no warnings;
' . PLP::source($PLP::file, 0, join ' ', (caller)[2,1]);
if ($@) {
PLP::Functions::exit() if $@ =~ /\cS\cT\cO\cP/;
PLP::error($@, 1);
if ($@) {
PLP::Functions::exit() if $@ =~ /\cS\cT\cO\cP/;
PLP::error($@, 1);
@@
-37,6
+38,7
@@
sub PLP_END (&) {
sub Entity (@) {
my $ref = defined wantarray ? [@_] : \@_;
for (@$ref) {
sub Entity (@) {
my $ref = defined wantarray ? [@_] : \@_;
for (@$ref) {
+ defined or next;
eval {
s/&/&/g;
s/"/"/g;
eval {
s/&/&/g;
s/"/"/g;
@@
-53,6
+55,7
@@
sub Entity (@) {
sub DecodeURI (@) {
my $ref = defined wantarray ? [@_] : \@_;
for (@$ref) {
sub DecodeURI (@) {
my $ref = defined wantarray ? [@_] : \@_;
for (@$ref) {
+ defined or next;
eval {
tr/+/ /; # Browsers do tr/ /+/ - I don't care about RFCs, but
# I do care about real-life situations.
eval {
tr/+/ /; # Browsers do tr/ /+/ - I don't care about RFCs, but
# I do care about real-life situations.
@@
-65,6
+68,7
@@
sub DecodeURI (@) {
sub EncodeURI (@) {
my $ref = defined wantarray ? [@_] : \@_;
for (@$ref) {
sub EncodeURI (@) {
my $ref = defined wantarray ? [@_] : \@_;
for (@$ref) {
+ defined or next;
eval {
s{([^A-Za-z0-9\-_.!~*'()/?:@\$,])}{sprintf("%%%02x", ord $1)}ge;
};
eval {
s{([^A-Za-z0-9\-_.!~*'()/?:@\$,])}{sprintf("%%%02x", ord $1)}ge;
};
@@
-74,7
+78,7
@@
sub EncodeURI (@) {
sub AddCookie ($) {
if ($PLP::Script::header{'Set-Cookie'}) {
sub AddCookie ($) {
if ($PLP::Script::header{'Set-Cookie'}) {
- $PLP::Script::header{'Set-Cookie'} .= "\n
Set-Cookie: $_[0]"
;
+ $PLP::Script::header{'Set-Cookie'} .= "\n
" . $_[0]
;
} else {
$PLP::Script::header{'Set-Cookie'} = $_[0];
}
} else {
$PLP::Script::header{'Set-Cookie'} = $_[0];
}