aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2018-11-29 20:36:21 +0100
committerMax Kostikov <max@kostikov.co>2018-11-29 20:36:21 +0100
commit3265c2e54305fd46fdb237d716d34b4e77e98e08 (patch)
treeaefceb91178f711598dd9fba1a1ada256e5d0d12 /include/text.php
parent1a9ea6452305c44df285e16f17475a5b16b54a37 (diff)
downloadvolse-hubzilla-3265c2e54305fd46fdb237d716d34b4e77e98e08.tar.gz
volse-hubzilla-3265c2e54305fd46fdb237d716d34b4e77e98e08.tar.bz2
volse-hubzilla-3265c2e54305fd46fdb237d716d34b4e77e98e08.zip
Skip sslify for images if it already were cached with https enabled
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php
index bb9c6075b..426229d36 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1111,7 +1111,8 @@ function linkify($s, $me = false) {
function sslify($s) {
// Local photo cache
- if(get_config('system','photo_cache_enable', 0) && local_channel()) {
+ $cacheon = get_config('system','photo_cache_enable', 0);
+ if($cache && local_channel()) {
$matches = null;
$cnt = preg_match_all("/\<img(.+?)src=[\"|'](https?\:.*?)[\"|'](.*?)\>/",$s,$matches,PREG_SET_ORDER);
if ($cnt) {
@@ -1138,6 +1139,10 @@ function sslify($s) {
// Complain to your browser maker
$allow = get_config('system','sslify_everything');
+
+ //We can skip next part if this only images and cache is on
+ if((! $allow) && $cacheon)
+ return $s;
$pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\<img(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" );