From 085f7ff3dd25b229c10aa1cb83eb516199a939a8 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 23 Mar 2015 12:10:00 +0100 Subject: Limit URI escape hack to concrete =- issue (to not wreak havoc elsewhere). --- mediawiki-uri-escape | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'mediawiki-uri-escape') 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($_); -- cgit v1.2.3