forked from friendica/friendica-addons
nsfw - use regex matching if word starts with '/'
This commit is contained in:
parent
86a45576b2
commit
895b263c8a
2 changed files with 14 additions and 7 deletions
BIN
nsfw.tgz
BIN
nsfw.tgz
Binary file not shown.
|
@ -86,14 +86,21 @@ function nsfw_prepare_body(&$a,&$b) {
|
|||
if(! strlen(trim($word))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(stristr($b['html'],$word)) {
|
||||
$found = true;
|
||||
break;
|
||||
if(strpos($word,'/') === 0) {
|
||||
if(preg_match($word,$b['html'])) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(stristr($b['item']['tag'], ']' . $word . '[' )) {
|
||||
$found = true;
|
||||
break;
|
||||
else {
|
||||
if(stristr($b['html'],$word)) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
if(stristr($b['item']['tag'], ']' . $word . '[' )) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue