aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/ActivityStreams.php6
-rw-r--r--Zotlabs/Lib/Enotify.php2
-rw-r--r--Zotlabs/Module/Setup.php4
-rw-r--r--Zotlabs/Photo/PhotoDriver.php16
-rw-r--r--Zotlabs/Widget/Messages.php2
-rw-r--r--Zotlabs/Widget/Notes.php2
6 files changed, 15 insertions, 17 deletions
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index 1c278f2ee..e77b501b3 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -70,9 +70,12 @@ class ActivityStreams {
}
}
+ // This indicates only that we have sucessfully decoded JSON.
$this->valid = true;
- if (array_key_exists('type', $this->data) && array_key_exists('actor', $this->data) && array_key_exists('object', $this->data)) {
+ // Special handling for Mastodon "delete actor" activities which will often fail to verify
+ // because the key cannot be fetched. We will catch this condition elsewhere.
+ if (is_array($this->data) && array_key_exists('type', $this->data) && array_key_exists('actor', $this->data) && array_key_exists('object', $this->data)) {
if ($this->data['type'] === 'Delete' && $this->data['actor'] === $this->data['object']) {
$this->deleted = $this->data['actor'];
$this->valid = false;
@@ -81,6 +84,7 @@ class ActivityStreams {
}
+ // Attempt to assemble an Activity from what we were given.
if ($this->is_valid()) {
$this->id = $this->get_property_obj('id');
$this->type = $this->get_primary_type();
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 59e4d9a4e..07c426960 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -860,7 +860,7 @@ class Enotify {
// convert this logic into a json array just like the system notifications
$who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author');
- $body = html2plain(bbcode($item['body'], ['drop_media']), 75, true);
+ $body = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($body) {
$body = htmlentities($body, ENT_QUOTES, 'UTF-8', false);
}
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php
index f068cbef8..3a188d9ce 100644
--- a/Zotlabs/Module/Setup.php
+++ b/Zotlabs/Module/Setup.php
@@ -387,8 +387,8 @@ class Setup extends \Zotlabs\Web\Controller {
function check_php(&$phpath, &$checks) {
$help = '';
- if(version_compare(PHP_VERSION, '7.1') < 0) {
- $help .= t('PHP version 7.1 or greater is required.');
+ if(version_compare(PHP_VERSION, '8.0') < 0) {
+ $help .= t('PHP version 8.0 or greater is required.');
$this->check_add($checks, t('PHP version'), false, true, $help);
}
diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php
index 6bdb89ab1..f50ef17ae 100644
--- a/Zotlabs/Photo/PhotoDriver.php
+++ b/Zotlabs/Photo/PhotoDriver.php
@@ -344,19 +344,13 @@ abstract class PhotoDriver {
return false;
}
- /*
- * PHP 7.2 allows you to use a stream resource, which should reduce/avoid
- * memory exhaustion on large images.
- */
-
- if(version_compare(PHP_VERSION, '7.2.0') >= 0) {
- $f = @fopen($filename, 'rb');
- } else {
- $f = $filename;
- }
+ $f = @fopen($filename, 'rb');
if($f) {
- return @exif_read_data($f, null, true);
+ // exif_read_data accepts a stream resource in php > 7.2
+ $x = @exif_read_data($f, null, true);
+ fclose($f);
+ return $x;
}
return false;
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php
index d045ae85b..3d9ed8955 100644
--- a/Zotlabs/Widget/Messages.php
+++ b/Zotlabs/Widget/Messages.php
@@ -113,7 +113,7 @@ class Messages {
}
if (!$summary) {
- $summary = html2plain(bbcode($item['body'], ['drop_media' => true]), 75, true);
+ $summary = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($summary) {
$summary = htmlentities($summary, ENT_QUOTES, 'UTF-8', false);
}
diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php
index c9d08c6b7..836159edd 100644
--- a/Zotlabs/Widget/Notes.php
+++ b/Zotlabs/Widget/Notes.php
@@ -31,7 +31,7 @@ class Notes {
$o = replace_macros($tpl, array(
'$text' => $text,
- '$html' => bbcode($text),
+ '$html' => bbcode($text, ['tryoembed' => false]),
'$app' => ((isset($arr['app'])) ? true : false),
'$hidden' => ((isset($arr['hidden'])) ? true : false),
'$strings' => [