diff options
author | Alexandre Hannud Abdo <abdo@member.fsf.org> | 2015-01-25 02:08:59 -0200 |
---|---|---|
committer | Alexandre Hannud Abdo <abdo@member.fsf.org> | 2015-01-25 02:08:59 -0200 |
commit | 2e783dbe79be9db8f88dde092daa33592c1e3672 (patch) | |
tree | 4a752920e183f9ce69350f9b39d1236ebabf1c46 /include | |
parent | 63f1ae5e204cdb615a0edb0d16c4c471c2f3264e (diff) | |
download | volse-hubzilla-2e783dbe79be9db8f88dde092daa33592c1e3672.tar.gz volse-hubzilla-2e783dbe79be9db8f88dde092daa33592c1e3672.tar.bz2 volse-hubzilla-2e783dbe79be9db8f88dde092daa33592c1e3672.zip |
Call sslify with an extra path element so files keep their names
The main motivation for this is when saving images one doesn't
need to inspect and manually input the file's actual name.
There might be other benefits, perhaps in automated downloads.
Diffstat (limited to 'include')
-rw-r--r-- | include/text.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php index b6e4abf24..47694a17c 100644 --- a/include/text.php +++ b/include/text.php @@ -898,7 +898,8 @@ function sslify($s) { $cnt = preg_match_all("/\<(.*?)src=\"(http\:.*?)\"(.*?)\>/",$s,$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $match) { - $s = str_replace($match[2],z_root() . '/sslify?f=&url=' . urlencode($match[2]),$s); + $filename = basename( parse_url($match[2],PHP_URL_PATH) ); + $s = str_replace($match[2],z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($match[2]),$s); } } return $s; |