diff options
author | Pascal Terjan <pterjan@mandriva.org> | 2005-08-18 17:31:37 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mandriva.org> | 2005-08-18 17:31:37 +0000 |
commit | 2eb641e19d90a1c6aa1940ba92687c75e5afd353 (patch) | |
tree | 2895ef8732c12c83ed435b513eb1695b40f9c7bd /php.req | |
parent | 6c00f6b797cf462d0fd456961dca356587265025 (diff) | |
download | rpm-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-x | php.req | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; } } |