From f9a5efbfbe1f3b7e47e56914f67384814dbc3ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sun, 13 May 2018 23:32:41 +0200 Subject: [PATCH] Continued: - after function/method declaration, make a new line for curly brace - PR/PSR-2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- nsfw/nsfw.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 6dc24773..1bda9065 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -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);