aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Connections.php2
-rw-r--r--Zotlabs/Module/Photo.php7
-rw-r--r--include/channel.php6
-rw-r--r--include/nav.php2
-rw-r--r--include/opengraph.php10
-rw-r--r--util/po2php.php2
6 files changed, 19 insertions, 10 deletions
diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php
index fd645d239..f6133d5f8 100644
--- a/Zotlabs/Module/Connections.php
+++ b/Zotlabs/Module/Connections.php
@@ -324,7 +324,7 @@ class Connections extends \Zotlabs\Web\Controller {
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) . '&name=' . $rr['xchan_name'],
'oneway' => $oneway,
'connect' => (intval($rr['abook_not_here']) ? t('Connect') : ''),
- 'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_addr']) . '&interactive=0',
+ 'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_hash']) . '&interactive=0',
'connect_hover' => t('Connect at this location')
);
}
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index 59dc709e1..98b47a4a6 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -272,7 +272,12 @@ class Photo extends \Zotlabs\Web\Controller {
$maxage = $expires - time();
header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT");
- header("Cache-Control: max-age=" . $maxage . $cachecontrol);
+
+ // set CDN/Infrastructure caching much lower than maxage
+ // in the event that infrastructure caching is present.
+ $smaxage = intval($maxage/12);
+
+ header("Cache-Control: s-maxage=" . $smaxage . ", max-age=" . $maxage . $cachecontrol);
}
diff --git a/include/channel.php b/include/channel.php
index 5d583e4f1..29835eac6 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -2254,19 +2254,19 @@ function get_zcard($channel, $observer_hash = '', $args = array()) {
$cover_width = 425;
$size = 'hz_small';
$cover_size = PHOTO_RES_COVER_425;
- $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 80 , 'height' => 80, 'href' => $channel['xchan_photo_m']);
+ $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 80 , 'height' => 80, 'href' => $channel['xchan_photo_m'].'?rev='.strtotime($channel['xchan_photo_date']));
} elseif($maxwidth <= 900) {
$width = 900;
$cover_width = 850;
$size = 'hz_medium';
$cover_size = PHOTO_RES_COVER_850;
- $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 160 , 'height' => 160, 'href' => $channel['xchan_photo_l']);
+ $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 160 , 'height' => 160, 'href' => $channel['xchan_photo_l'].'?rev='.strtotime($channel['xchan_photo_date']));
} elseif($maxwidth <= 1200) {
$width = 1200;
$cover_width = 1200;
$size = 'hz_large';
$cover_size = PHOTO_RES_COVER_1200;
- $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 300 , 'height' => 300, 'href' => $channel['xchan_photo_l']);
+ $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 300 , 'height' => 300, 'href' => $channel['xchan_photo_l'].'?rev='.strtotime($channel['xchan_photo_date']));
}
// $scale = (float) $maxwidth / $width;
diff --git a/include/nav.php b/include/nav.php
index 3e1acd306..672cc2689 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -80,7 +80,7 @@ function nav($template = 'default') {
if($observer) {
$userinfo = [
- 'icon' => $observer['xchan_photo_m'],
+ 'icon' => $observer['xchan_photo_m'].'?rev='.strtotime($observer['xchan_photo_date']),
'name' => $observer['xchan_addr'],
];
}
diff --git a/include/opengraph.php b/include/opengraph.php
index 2d72ffca1..ba97d4f4f 100644
--- a/include/opengraph.php
+++ b/include/opengraph.php
@@ -21,8 +21,10 @@
$ogtitle = $item['title'];
// find first image if exist
- if(preg_match("/\[[zi]mg(=[0-9]+x[0-9]+)?\]([^\[]+)/is", $item['body'], $matches))
+ if(preg_match("/\[[zi]mg(=[0-9]+x[0-9]+)?\]([^\[]+)/is", $item['body'], $matches)) {
$ogimage = $matches[2];
+ $ogimagetype = guess_image_type($ogimage);
+ }
// use summary as description if exist
$ogdesc = (empty($item['summary']) ? $item['body'] : $item['summary'] );
@@ -57,12 +59,14 @@
}
}
- if(! isset($ogimage))
+ if(! isset($ogimage)) {
$ogimage = $channel['xchan_photo_l'];
+ $ogimagetype = $channel['xchan_photo_mimetype'];
+ }
App::$page['htmlhead'] .= '<meta property="og:title" content="' . htmlspecialchars((isset($ogtitle) ? $ogtitle : $channel['channel_name'])) . '">' . "\r\n";
App::$page['htmlhead'] .= '<meta property="og:image" content="' . $ogimage . '">' . "\r\n";
- App::$page['htmlhead'] .= '<meta property="og:image:type" content="' . guess_image_type($ogimage) . '">' . "\r\n";
+ App::$page['htmlhead'] .= '<meta property="og:image:type" content="' . $ogimagetype . '">' . "\r\n";
App::$page['htmlhead'] .= '<meta property="og:description" content="' . htmlspecialchars($ogdesc) . '">' . "\r\n";
App::$page['htmlhead'] .= '<meta property="og:type" content="' . (isset($ogtype) ? $ogtype : "profile") . '">' . "\r\n";
diff --git a/util/po2php.php b/util/po2php.php
index 73d9b454e..535e5567c 100644
--- a/util/po2php.php
+++ b/util/po2php.php
@@ -52,7 +52,7 @@ function po2php_run($argc,$argv) {
if ($l[0]=="#") $l="";
if (substr($l,0,15)=='"Plural-Forms: '){
$match=Array();
- preg_match("|nplurals=([0-9]*);\s*plural=(.*)[;\\\\]|", $l, $match);
+ preg_match("|nplurals=([0-9]*);\s*plural=([^;\\\\]*)|", $l, $match);
$cond = str_replace('n','$n',$match[2]);
$out .= 'if(! function_exists("' . 'string_plural_select_' . $lang .'")) {' . "\n";
$out .= 'function string_plural_select_' . $lang . '($n){'."\n";