diff options
author | Jonas Smedegaard <dr@jones.dk> | 2015-03-23 12:10:00 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2015-03-23 12:10:00 +0100 |
commit | 085f7ff3dd25b229c10aa1cb83eb516199a939a8 (patch) | |
tree | 3f2c0f0bf853f61dabe589469aa045302e137f08 | |
parent | 9232a4191f87713879309ae695b0d3fe967104e0 (diff) |
Limit URI escape hack to concrete =- issue (to not wreak havoc elsewhere).
-rwxr-xr-x | mediawiki-uri-escape | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/mediawiki-uri-escape b/mediawiki-uri-escape index 3377744..196e1c6 100755 --- a/mediawiki-uri-escape +++ b/mediawiki-uri-escape @@ -7,17 +7,13 @@ use strict; use Path::Tiny; use Regexp::Common qw(net); -use URI::Escape; my $infile = shift; my $outfile = shift || $infile; $_ = path($infile)->slurp_utf8; -my $uri_path = qr!https?://$RE{net}{domain}{-nospace}(?::\d+)?\K(/\S*?)!; -my $uri_end = qr!(?=[.,;]?[\s<\"\|}\]])!; - -s|\b$uri_path$uri_end|uri_escape(uri_unescape($1), "^A-Za-z0-9/\.")|eg; +s/=-/%3D%2D/g; path($outfile)->spew_utf8($_); |