mirror of
https://github.com/friendica/friendica
synced 2025-03-11 17:48:26 +00: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
|
||||
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) {
|
||||
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue