mirror of
https://github.com/friendica/friendica
synced 2025-04-26 18:30:11 +00:00
Improved checks in "storeForUserByUriId" to reduce recursion depth
This commit is contained in:
parent
3e2c684319
commit
6070221364
2 changed files with 74 additions and 31 deletions
|
@ -471,6 +471,26 @@ class Tag
|
|||
return DBA::selectToArray('tag-view', ['type', 'name', 'url', 'tag-type'], $condition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given url is mentioned in the post
|
||||
*
|
||||
* @param integer $uriId
|
||||
* @param string $url
|
||||
* @param array $type
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isMentioned(int $uriId, string $url, array $type = [self::MENTION, self::EXCLUSIVE_MENTION]): bool
|
||||
{
|
||||
$tags = self::getByURIId($uriId, $type);
|
||||
foreach ($tags as $tag) {
|
||||
if (Strings::compareLink($url, $tag['url'])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string with all tags and mentions
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue