mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-08-23 06:34:00 +00:00
Fix several warnings
This commit is contained in:
parent
e76575eb52
commit
1cc54a83a9
3 changed files with 5 additions and 5 deletions
|
@ -120,7 +120,7 @@ function advancedcontentfilter_prepare_body_content_filter(&$hook_data)
|
|||
$expressionLanguage = new ExpressionLanguage\ExpressionLanguage();
|
||||
}
|
||||
|
||||
$uid = $hook_data['uid'] ?: DI::userSession()->getLocalUserId();
|
||||
$uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId();
|
||||
if (!$uid) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ function langfilter_addon_settings_post(array &$b)
|
|||
|
||||
function langfilter_prepare_body_content_filter(&$hook_data)
|
||||
{
|
||||
$uid = $hook_data['uid'] ?: DI::userSession()->getLocalUserId();
|
||||
$uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId();
|
||||
if (!$uid) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ function nsfw_addon_settings_post(array &$b)
|
|||
function nsfw_prepare_body_content_filter(&$hook_data)
|
||||
{
|
||||
$words = null;
|
||||
$uid = $hook_data['uid'] ?: DI::userSession()->getLocalUserId();
|
||||
$uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId();
|
||||
if (DI::pConfig()->get($uid, 'nsfw', 'disable')) {
|
||||
return;
|
||||
}
|
||||
|
@ -137,10 +137,10 @@ function nsfw_prepare_body_content_filter(&$hook_data)
|
|||
break;
|
||||
case '#': // Hashtag-only search
|
||||
$tag_search = true;
|
||||
$found = nsfw_find_word_in_item_tags($hook_data['item']['hashtags'], substr($word, 1));
|
||||
$found = nsfw_find_word_in_item_tags($hook_data['item']['hashtags'] ?? [], substr($word, 1));
|
||||
break;
|
||||
default:
|
||||
$found = strpos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'], $word);
|
||||
$found = strpos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'] ?? [], $word);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue