nsfw - use regex matching if word starts with '/'
parent
86a45576b2
commit
895b263c8a
|
@ -86,7 +86,13 @@ function nsfw_prepare_body(&$a,&$b) {
|
|||
if(! strlen(trim($word))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(strpos($word,'/') === 0) {
|
||||
if(preg_match($word,$b['html'])) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(stristr($b['html'],$word)) {
|
||||
$found = true;
|
||||
break;
|
||||
|
@ -97,6 +103,7 @@ function nsfw_prepare_body(&$a,&$b) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($found) {
|
||||
$rnd = random_string(8);
|
||||
$b['html'] = '<div id="nsfw-wrap-' . $rnd . '" class="fakelink" onclick=openClose(\'nsfw-' . $rnd . '\'); >' . sprintf( t('%s - Click to open/close'),$word ) . '</div><div id="nsfw-' . $rnd . '" style="display: none; " >' . $b['html'] . '</div>';
|
||||
|
|
Loading…
Reference in New Issue