aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Articles.php12
-rw-r--r--Zotlabs/Module/Photo.php11
-rw-r--r--include/network.php15
3 files changed, 31 insertions, 7 deletions
diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php
index 58c16be45..ca132c01e 100644
--- a/Zotlabs/Module/Articles.php
+++ b/Zotlabs/Module/Articles.php
@@ -17,8 +17,16 @@ class Articles extends Controller {
if(argc() > 1)
$which = argv(1);
- else
- return;
+
+ if(! $which) {
+ if(local_channel()) {
+ $channel = App::get_channel();
+ if($channel && $channel['channel_address'])
+ $which = $channel['channel_address'];
+ } else {
+ return;
+ }
+ }
profile_load($which);
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index ddff3a68e..e236cc5f4 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -32,7 +32,7 @@ class Photo extends \Zotlabs\Web\Controller {
}
$cache_mode = array(
- 'on' => get_config('system','photo_cache_enable', 0),
+ 'on' => false,
'age' => 86400,
'exp' => true,
'leak' => false
@@ -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/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'))