]> git.mxchange.org Git - friendica.git/commitdiff
Improved logging, improved link check
authorMichael <heluecht@pirati.ca>
Tue, 6 Jul 2021 17:40:40 +0000 (17:40 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 6 Jul 2021 17:40:40 +0000 (17:40 +0000)
src/Content/Text/BBCode.php
src/Model/Post/Link.php

index c2db7ccb23017bf6391db99b1d43c6795dd4c34f..dbd9a5d9aa5409ad0a48f1d5cab35953267e5900 100644 (file)
@@ -252,7 +252,7 @@ class BBCode
                $post = self::getAttachmentData($body);
 
                // Get all linked images with alternative image description
-               if (preg_match_all("/\[img=([^\[\]]*)\]([^\[\]]*)\[\/img\]/Usi", $body, $pictures, PREG_SET_ORDER)) {
+               if (preg_match_all("/\[img=(http[^\[\]]*)\]([^\[\]]*)\[\/img\]/Usi", $body, $pictures, PREG_SET_ORDER)) {
                        foreach ($pictures as $picture) {
                                if (Photo::isLocal($picture[1])) {
                                        $post['images'][] = ['url' => str_replace('-1.', '-0.', $picture[1]), 'description' => $picture[2]];
index 7cce4e206ba6f1402f9b92d7bb4b1db2f40f6360..758f00f1c64170a5d510f1c0b47b4c99b59a35ce 100644 (file)
@@ -22,6 +22,7 @@
 namespace Friendica\Model\Post;
 
 use Friendica\Core\Logger;
+use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Util\Proxy;
@@ -40,7 +41,7 @@ class Link
                }
 
                if (!in_array(parse_url($url, PHP_URL_SCHEME), ['http', 'https'])) {
-                       Logger::info('Bad URL, quitting', ['uri-id' => $uri_id, 'url' => $url]);
+                       Logger::info('Bad URL, quitting', ['uri-id' => $uri_id, 'url' => $url, 'callstack' => System::callstack(20)]);
                        return $url;
                }