Merge branch 'dev' into dark-fix-dev

This commit is contained in:
phani00 2018-12-17 15:18:24 +00:00
commit d80b8ff30f
4 changed files with 35 additions and 8 deletions

View File

@ -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();
}
}

View File

@ -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);

View File

@ -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();

View File

@ -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'))