From 5bb9c57fdbfe6ee69c0ffaad52b9d4259a6b97f5 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 20 Jul 2013 15:24:07 +0200 Subject: urldecode: rewrite in php Faster than pure bash and simple enough. Signed-off-by: Florian Pritz --- urldecode | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'urldecode') diff --git a/urldecode b/urldecode index 19df702..dcea3e2 100755 --- a/urldecode +++ b/urldecode @@ -1,16 +1,10 @@ -#!/bin/bash -arg="$1" -i="0" -while [ "$i" -lt ${#arg} ]; do - c0=${arg:$i:1} - if [ "x$c0" = "x%" ]; then - c1=${arg:$((i+1)):1} - c2=${arg:$((i+2)):1} - printf "\x$c1$c2" - i=$((i+3)) - else - echo -n "$c0" - i=$((i+1)) - fi -done +#!/usr/bin/php +