mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 21:24:27 +02:00
Avoid matching invalid URLs in Model\Post\Media::insertFromRelevantUrl
- Replace * with + to prevent matching empty domains
This commit is contained in:
parent
657c04a041
commit
b4b7e9a3c7
1 changed files with 1 additions and 1 deletions
|
@ -796,7 +796,7 @@ class Media
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for links with descriptions
|
// Search for links with descriptions
|
||||||
if (preg_match_all("/\[url\=(https?:.*?)\].*?\[\/url\]/ism", $body, $matches)) {
|
if (preg_match_all("#\[url=(https?://.+?)].+?\[/url]#ism", $body, $matches)) {
|
||||||
foreach ($matches[1] as $url) {
|
foreach ($matches[1] as $url) {
|
||||||
DI::logger()->info('Got page url (link with description)', ['uri-id' => $uriid, 'url' => $url]);
|
DI::logger()->info('Got page url (link with description)', ['uri-id' => $uriid, 'url' => $url]);
|
||||||
$result = self::insert(['uri-id' => $uriid, 'type' => self::UNKNOWN, 'url' => $url], false);
|
$result = self::insert(['uri-id' => $uriid, 'type' => self::UNKNOWN, 'url' => $url], false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue