aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Photo.php9
-rw-r--r--Zotlabs/Module/Setup.php5
-rw-r--r--Zotlabs/Module/Sslify.php14
-rw-r--r--include/network.php15
4 files changed, 35 insertions, 8 deletions
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index 7365a5f64..e236cc5f4 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -159,13 +159,14 @@ class Photo extends \Zotlabs\Web\Controller {
// Validate cache
$cache = array(
'resid' => $photo,
- 'uid' => $r[0]['uid'],
- 'status' => false
+ 'url' => htmlspecialchars_decode($r[0]['display_path'])
);
if($cache_mode['on'])
call_hooks('cache_url_hook', $cache);
- if(! $cache['status']) {
- header("Location: " . htmlspecialchars_decode($r[0]['display_path']));
+ if($cache['url'] != '') {
+ if(strpos(z_root(),'https:') !== false && strpos($cache['url'],'https:') === false)
+ $cache['url'] = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($cache['url']);
+ header("Location: " . $cache['url']);
killme();
}
}
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php
index c0716ca7c..370b7b9f8 100644
--- a/Zotlabs/Module/Setup.php
+++ b/Zotlabs/Module/Setup.php
@@ -441,13 +441,18 @@ class Setup extends \Zotlabs\Web\Controller {
require_once 'include/environment.php';
$help = '';
+ $mem_warning = '';
$result = getPhpiniUploadLimits();
+ if($result['post_max_size'] < 4194304 || $result['max_upload_filesize'] < 4194304) {
+ $mem_warning = '<strong>' .t('This is not sufficient to upload larger images or files. You should be able to upload at least 4 MB at once.') . '</strong>';
+ }
$help = sprintf(t('Your max allowed total upload size is set to %s. Maximum size of one file to upload is set to %s. You are allowed to upload up to %d files at once.'),
userReadableSize($result['post_max_size']),
userReadableSize($result['max_upload_filesize']),
$result['max_file_uploads']
);
+ $help .= $mem_warning;
$help .= '<br><br>' . t('You can adjust these settings in the server php.ini file.');
$this->check_add($checks, t('PHP upload limits'), true, false, $help);
diff --git a/Zotlabs/Module/Sslify.php b/Zotlabs/Module/Sslify.php
index 2891f3691..37be4423b 100644
--- a/Zotlabs/Module/Sslify.php
+++ b/Zotlabs/Module/Sslify.php
@@ -12,10 +12,16 @@ class Sslify extends \Zotlabs\Web\Controller {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$hdrs[strtolower($k)] = $v;
}
- if (array_key_exists('content-type', $hdrs)) {
- $type = $hdrs['content-type'];
- header('Content-Type: ' . $type);
- }
+
+ if (array_key_exists('content-type', $hdrs))
+ header('Content-Type: ' . $hdrs['content-type']);
+ if (array_key_exists('last-modified', $hdrs))
+ header('Last-Modified: ' . $hdrs['last-modified']);
+ if (array_key_exists('cache-control', $hdrs))
+ header('Cache-Control: ' . $hdrs['cache-control']);
+ if (array_key_exists('expires', $hdrs))
+ header('Expires: ' . $hdrs['expires']);
+
echo $x['body'];
killme();
diff --git a/include/network.php b/include/network.php
index cd352e7db..df59a30e6 100644
--- a/include/network.php
+++ b/include/network.php
@@ -120,6 +120,14 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
}
+ if(array_key_exists('http_version',$opts)) {
+ @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
+ }
+ else {
+ @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
+ }
+
+
if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
if(x($opts,'cookiefile'))
@@ -290,6 +298,13 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
}
+ if(array_key_exists('http_version',$opts)) {
+ @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
+ }
+ else {
+ @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
+ }
+
if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
if(x($opts,'cookiefile'))