aboutsummaryrefslogtreecommitdiffstats
path: root/php.req
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2005-08-18 17:31:37 +0000
committerPascal Terjan <pterjan@mandriva.org>2005-08-18 17:31:37 +0000
commit2eb641e19d90a1c6aa1940ba92687c75e5afd353 (patch)
tree2895ef8732c12c83ed435b513eb1695b40f9c7bd /php.req
parent6c00f6b797cf462d0fd456961dca356587265025 (diff)
downloadrpm-setup-2eb641e19d90a1c6aa1940ba92687c75e5afd353.tar
rpm-setup-2eb641e19d90a1c6aa1940ba92687c75e5afd353.tar.gz
rpm-setup-2eb641e19d90a1c6aa1940ba92687c75e5afd353.tar.bz2
rpm-setup-2eb641e19d90a1c6aa1940ba92687c75e5afd353.tar.xz
rpm-setup-2eb641e19d90a1c6aa1940ba92687c75e5afd353.zip
Also fix */../* */./* *//*
Diffstat (limited to 'php.req')
-rwxr-xr-xphp.req8
1 files changed, 5 insertions, 3 deletions
diff --git a/php.req b/php.req
index 6c5b81c..1ba5cd7 100755
--- a/php.req
+++ b/php.req
@@ -35,10 +35,10 @@ foreach (@ARGV ? $ARGV : <> ) {
while (<F>) {
# skip comments
next if (/^\s*(#|\/\/|\*|\/\*)/);
-
while (/(\W|^)(require|include)(_once)?
\s* \(? \s* ("([^"]*)"|'([^']*)')
\s* \)? \s* ;/xg) {
+
if ($5 ne "") {
$x = $5;
} elsif ($6 ne "") {
@@ -46,7 +46,8 @@ foreach (@ARGV ? $ARGV : <> ) {
} else {
next;
}
-
+ do $x =~ s/\/\.?\//\//g while $x =~ /\/\.?\//;
+ do $x =~ s/(\/|^)[^\/]*[^.]\/\.\.\//\1/g while $x =~ /(\/|^)[^\/]*[^.]\/\.\.\//;
next if ($x =~ m|^\.\.?/| or $x =~ /\$/);
next unless ($x =~ /\.php$/);
$req{$x} = 1;
@@ -69,7 +70,8 @@ foreach (@ARGV ? $ARGV : <> ) {
next unless ($x =~ /\.php$/);
$x = "$file_dir/$x";
- $x =~ s|/+|/|g;
+ do $x =~ s/\/\.?\//\//g while $x =~ /\/\.?\//;
+ do $x =~ s/(\/|^)[^\/]*[^.]\/\.\.\//\1/g while $x =~ /(\/|^)[^\/]*[^.]\/\.\.\//;
$req{$x} = 1;
}
}