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:
Roland Häder 2018-05-13 23:32:41 +02:00
parent cbd18c5d99
commit f9a5efbfbe

View file

@ -97,7 +97,8 @@ function nsfw_addon_settings(&$a, &$s)
return; return;
} }
function nsfw_addon_settings_post(App $a, array &$b) { function nsfw_addon_settings_post(App $a, array &$b)
{
if (!local_user()) { if (!local_user()) {
return; 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; $words = null;
if (PConfig::get(local_user(), 'nsfw', 'disable')) { if (PConfig::get(local_user(), 'nsfw', 'disable')) {
return; return;
} }
@ -128,16 +131,19 @@ function nsfw_prepare_body_content_filter(App $a, &$hook_data) {
} }
$found = false; $found = false;
if (count($word_list)) { if (count($word_list)) {
$body = $hook_data['item']['title'] . "\n" . nsfw_extract_photos($hook_data['item']['body']); $body = $hook_data['item']['title'] . "\n" . nsfw_extract_photos($hook_data['item']['body']);
foreach ($word_list as $word) { foreach ($word_list as $word) {
$word = trim($word); $word = trim($word);
if (!strlen($word)) { if (!strlen($word)) {
continue; continue;
} }
$tag_search = false; $tag_search = false;
switch ($word[0]) { switch ($word[0]) {
case '/'; // Regular expression case '/'; // Regular expression
$found = preg_match($word, $body); $found = preg_match($word, $body);