addons:
- bufferapp (missing errorcode)
- twitter (wrong field name 'nickname')
core:
- bbcode (incomplete attachementdata)
- crypto (uninitialized key)
*/
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);
*/
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
$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);
+ }
}
/**