mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-17 05:48:49 +00:00
Continued:
- after function/method declaration, make a new line for curly brace - PR/PSR-2 Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
cbd18c5d99
commit
f9a5efbfbe
1 changed files with 8 additions and 2 deletions
|
@ -97,7 +97,8 @@ function nsfw_addon_settings(&$a, &$s)
|
|||
return;
|
||||
}
|
||||
|
||||
function nsfw_addon_settings_post(App $a, array &$b) {
|
||||
function nsfw_addon_settings_post(App $a, array &$b)
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
}
|
||||
|
@ -111,8 +112,10 @@ function nsfw_addon_settings_post(App $a, array &$b) {
|
|||
}
|
||||
}
|
||||
|
||||
function nsfw_prepare_body_content_filter(App $a, &$hook_data) {
|
||||
function nsfw_prepare_body_content_filter(App $a, &$hook_data)
|
||||
{
|
||||
$words = null;
|
||||
|
||||
if (PConfig::get(local_user(), 'nsfw', 'disable')) {
|
||||
return;
|
||||
}
|
||||
|
@ -128,16 +131,19 @@ function nsfw_prepare_body_content_filter(App $a, &$hook_data) {
|
|||
}
|
||||
|
||||
$found = false;
|
||||
|
||||
if (count($word_list)) {
|
||||
$body = $hook_data['item']['title'] . "\n" . nsfw_extract_photos($hook_data['item']['body']);
|
||||
|
||||
foreach ($word_list as $word) {
|
||||
$word = trim($word);
|
||||
|
||||
if (!strlen($word)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$tag_search = false;
|
||||
|
||||
switch ($word[0]) {
|
||||
case '/'; // Regular expression
|
||||
$found = preg_match($word, $body);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue