summaryrefslogtreecommitdiffstats
path: root/urldecode
diff options
context:
space:
mode:
Diffstat (limited to 'urldecode')
-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));
}
}