aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKevin Canévet <kevin@streamroot.io>2015-11-08 23:06:21 +0100
committerArthurHoaro <arthur@hoa.ro>2016-03-24 08:34:47 +0100
commitecd051905f0c8aa97590eb453d553dc678125a50 (patch)
tree7f0171d3ee871c80e638b95a746284d2e6605f13
parent5816801b15e1a0e53f87aa48267243bff44b5f64 (diff)
downloadShaarli-ecd051905f0c8aa97590eb453d553dc678125a50.tar.gz
Shaarli-ecd051905f0c8aa97590eb453d553dc678125a50.tar.zst
Shaarli-ecd051905f0c8aa97590eb453d553dc678125a50.zip
Fix issue 366, Problem when shaaring a link in Reader View of Firefox.
-rw-r--r--application/Url.php16
1 files changed, 15 insertions, 1 deletions
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
125 } 125 }
126 } 126 }
127 127
128
129 private function removeFirefoxAboutReader($input){
130 $output_array = [];
131 preg_match("%^about://reader\?url=(.*)%", $input, $output_array);
132 if(!empty($output_array)){
133 $extractedUrl = preg_replace("%^about://reader\?url=(.*)%", "$1", $input);
134 $url = urldecode($extractedUrl);
135 }else{
136 $url = $input;
137 }
138 return $url;
139 }
140
128 /** 141 /**
129 * Returns a string representation of this URL 142 * Returns a string representation of this URL
130 */ 143 */
@@ -187,7 +200,8 @@ class Url
187 { 200 {
188 $this->cleanupQuery(); 201 $this->cleanupQuery();
189 $this->cleanupFragment(); 202 $this->cleanupFragment();
190 return $this->toString(); 203 $url = $this->toString();
204 return $this->removeFirefoxAboutReader($url);
191 } 205 }
192 206
193 /** 207 /**