From: Kevin Canévet Date: Sun, 8 Nov 2015 22:06:21 +0000 (+0100) Subject: Fix issue 366, Problem when shaaring a link in Reader View of Firefox. X-Git-Tag: v0.7.0~20^2~1 X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=commitdiff_plain;h=ecd051905f0c8aa97590eb453d553dc678125a50 Fix issue 366, Problem when shaaring a link in Reader View of Firefox. --- diff --git a/application/Url.php b/application/Url.php index a4ac2e73..e7c3a4cc 100644 --- a/application/Url.php +++ b/application/Url.php @@ -125,6 +125,19 @@ class Url } } + + private function removeFirefoxAboutReader($input){ + $output_array = []; + preg_match("%^about://reader\?url=(.*)%", $input, $output_array); + if(!empty($output_array)){ + $extractedUrl = preg_replace("%^about://reader\?url=(.*)%", "$1", $input); + $url = urldecode($extractedUrl); + }else{ + $url = $input; + } + return $url; + } + /** * Returns a string representation of this URL */ @@ -187,7 +200,8 @@ class Url { $this->cleanupQuery(); $this->cleanupFragment(); - return $this->toString(); + $url = $this->toString(); + return $this->removeFirefoxAboutReader($url); } /**