From: Philipp Holzer Date: Tue, 27 Aug 2019 06:27:07 +0000 (+0200) Subject: php notice fixings X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=df7ec0cdf7fdaf75a5897016f69254a97066f429;p=friendica.git php notice fixings addons: - bufferapp (missing errorcode) - twitter (wrong field name 'nickname') core: - bbcode (incomplete attachementdata) - crypto (uninitialized key) --- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index c16041e220..bd4fc73c15 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -120,7 +120,16 @@ class BBCode extends BaseObject */ public static function getAttachmentData($body) { - $data = []; + // Initialize empty data array + $data = [ + 'type' => '', + 'text' => '', + 'after' => '', + 'image' => null, + 'url' => '', + 'title' => '', + 'description' => '', + ]; if (!preg_match("/(.*)\[attachment(.*?)\](.*?)\[\/attachment\](.*)/ism", $body, $match)) { return self::getOldAttachmentData($body); diff --git a/src/Util/Crypto.php b/src/Util/Crypto.php index 78f7c349a7..a45fdf9faa 100644 --- a/src/Util/Crypto.php +++ b/src/Util/Crypto.php @@ -4,12 +4,12 @@ */ namespace Friendica\Util; +use ASN_BASE; +use ASNValue; use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\System; -use ASN_BASE; -use ASNValue; /** * @brief Crypto class @@ -209,8 +209,10 @@ class Crypto $r = ASN_BASE::parseASNString($x); - $m = Strings::base64UrlDecode($r[0]->asnData[1]->asnData[0]->asnData[0]->asnData); - $e = Strings::base64UrlDecode($r[0]->asnData[1]->asnData[0]->asnData[1]->asnData); + if (isset($r[0])) { + $m = Strings::base64UrlDecode($r[0]->asnData[1]->asnData[0]->asnData[0]->asnData); + $e = Strings::base64UrlDecode($r[0]->asnData[1]->asnData[0]->asnData[1]->asnData); + } } /**