Improved logging, improved link check
This commit is contained in:
parent
ecf0b67d9d
commit
f3452d86c4
2 changed files with 3 additions and 2 deletions
|
@ -252,7 +252,7 @@ class BBCode
|
||||||
$post = self::getAttachmentData($body);
|
$post = self::getAttachmentData($body);
|
||||||
|
|
||||||
// Get all linked images with alternative image description
|
// 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) {
|
foreach ($pictures as $picture) {
|
||||||
if (Photo::isLocal($picture[1])) {
|
if (Photo::isLocal($picture[1])) {
|
||||||
$post['images'][] = ['url' => str_replace('-1.', '-0.', $picture[1]), 'description' => $picture[2]];
|
$post['images'][] = ['url' => str_replace('-1.', '-0.', $picture[1]), 'description' => $picture[2]];
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
namespace Friendica\Model\Post;
|
namespace Friendica\Model\Post;
|
||||||
|
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Proxy;
|
use Friendica\Util\Proxy;
|
||||||
|
@ -40,7 +41,7 @@ class Link
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array(parse_url($url, PHP_URL_SCHEME), ['http', 'https'])) {
|
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;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue