From: Robert 'phaylon' Sedlacek Date: Wed, 20 Jun 2012 19:14:21 +0000 (+0000) Subject: change uri path escaping to use backslashes to secure forward slashes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b04ffd15c2700ee4199f6f7f2b43006b4b8a072;p=scpubgit%2FJSON-Tree-Viewer.git change uri path escaping to use backslashes to secure forward slashes --- diff --git a/br.pl b/br.pl index 2e30991..590d940 100644 --- a/br.pl +++ b/br.pl @@ -40,7 +40,11 @@ sub dispatch_request { }, }, sub (/**/) { - $self->structure(split '/', $_[1]); + $self->structure(map { + s{\\/}{/}g; + s{\\\\}{\\}g; + $_; + } split qr{(?, "Explore $to", + , "Explore $to", ); return \$html; } @@ -171,7 +179,7 @@ sub descend { $target = $self->json->decode(scalar $target->all); } return $target unless @path; - my $step = uri_unescape(uri_unescape( shift @path)); + my $step = shift @path; $self->descend($target->{$step}, @path); }