Merge branch 'dev'

This commit is contained in:
zotlabs 2018-09-16 22:08:00 -07:00
commit d6841635ff
2 changed files with 6 additions and 5 deletions

View file

@ -1182,7 +1182,7 @@ class Activity {
// sort function width decreasing // sort function width decreasing
static function as_vid_sort($a,$b) { static function vid_sort($a,$b) {
if($a['width'] === $b['width']) if($a['width'] === $b['width'])
return 0; return 0;
return (($a['width'] > $b['width']) ? -1 : 1); return (($a['width'] > $b['width']) ? -1 : 1);
@ -1348,7 +1348,7 @@ class Activity {
} }
} }
if($mps) { if($mps) {
usort($mps,'as_vid_sort'); usort($mps,[ __CLASS__, 'vid_sort' ]);
foreach($mps as $m) { foreach($mps as $m) {
if(intval($m['width']) < 500) { if(intval($m['width']) < 500) {
$s['body'] .= "\n\n" . '[video]' . $m['href'] . '[/video]'; $s['body'] .= "\n\n" . '[video]' . $m['href'] . '[/video]';
@ -1551,7 +1551,7 @@ class Activity {
} }
} }
if($mps) { if($mps) {
usort($mps,'as_vid_sort'); usort($mps,[ __CLASS__, 'vid_sort' ]);
foreach($mps as $m) { foreach($mps as $m) {
if(intval($m['width']) < 500) { if(intval($m['width']) < 500) {
$s['body'] .= "\n\n" . '[video]' . $m['href'] . '[/video]'; $s['body'] .= "\n\n" . '[video]' . $m['href'] . '[/video]';

View file

@ -4,6 +4,7 @@ use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Zotfinger; use Zotlabs\Lib\Zotfinger;
use Zotlabs\Lib\ActivityStreams; use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\Activity; use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityPub;
/** /**
* @file include/network.php * @file include/network.php
@ -1222,8 +1223,8 @@ function discover_by_webbie($webbie, $protocol = '') {
} }
} }
if(strpos($url,'http') === 0) { if(strpos($webbie,'http') === 0) {
$ap = ActivityPub::discover($link['href']); $ap = ActivityPub::discover($webbie);
if($ap) { if($ap) {
return $ap; return $ap;
} }