summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-07-21 13:48:16 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-07-21 13:48:16 +0200
commit8a7bd7ec70868a5f027bc0bd26ae45a6491f21d2 (patch)
tree5fe82763511c81a02b34ba6c5011b704eb0e23de
parent5bb9c57fdbfe6ee69c0ffaad52b9d4259a6b97f5 (diff)
downloadbin-8a7bd7ec70868a5f027bc0bd26ae45a6491f21d2.tar.gz
bin-8a7bd7ec70868a5f027bc0bd26ae45a6491f21d2.tar.xz
urldecode: don't read the script itself
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xurldecode6
1 files changed, 4 insertions, 2 deletions
diff --git a/urldecode b/urldecode
index dcea3e2..2dbf117 100755
--- a/urldecode
+++ b/urldecode
@@ -1,10 +1,12 @@
#!/usr/bin/php
<?php
-if (count($argv) == 0) {
+if (count($argv) == 1) {
echo urldecode(file_get_contents("php://stdin"));
} else {
- foreach ($argv as $arg) {
+ $args = $argv;
+ unset($args[0]);
+ foreach ($args as $arg) {
echo urldecode(file_get_contents($arg));
}
}