Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -426,7 +426,7 @@ class _Profanity extends \IPS\Patterns\ActiveRecord implements \JsonSerializable
|
||||
{
|
||||
if ( \in_array( mb_strtolower( $section ), array_map( 'mb_strtolower', $exactProfanity ) ) )
|
||||
{
|
||||
return $word;
|
||||
return $section;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -457,14 +457,14 @@ class _Profanity extends \IPS\Patterns\ActiveRecord implements \JsonSerializable
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$urls = ( \IPS\Settings::i()->ipb_url_filter_option == 'black' ) ? explode( ',', \IPS\Settings::i()->ipb_url_blacklist ) : explode( ',', \IPS\Settings::i()->ipb_url_whitelist );
|
||||
$urls = ( \IPS\Settings::i()->ipb_url_filter_option == 'black' ) ? explode( ',', \IPS\Settings::i()->ipb_url_blacklist ) : ( \IPS\Settings::i()->ipb_url_filter_option != 'none' ? explode( ',', \IPS\Settings::i()->ipb_url_whitelist ) : [] );
|
||||
|
||||
if ( \IPS\Settings::i()->ipb_url_filter_option == 'white' )
|
||||
if ( \IPS\Settings::i()->ipb_url_filter_option == 'white' OR \IPS\Settings::i()->url_filter_any_action == 'moderate' )
|
||||
{
|
||||
$urls[] = "http://" . parse_url( \IPS\Settings::i()->base_url, PHP_URL_HOST ) . "/*";
|
||||
$urls[] = "https://" . parse_url( \IPS\Settings::i()->base_url, PHP_URL_HOST ) . "/*";
|
||||
}
|
||||
|
||||
|
||||
if ( $urls )
|
||||
{
|
||||
/* We are only checking the content to see if it should be filtered, not using it later. We need to fix embeds, otherwise they won't trigger post moderation
|
||||
@@ -486,7 +486,7 @@ class _Profanity extends \IPS\Patterns\ActiveRecord implements \JsonSerializable
|
||||
{
|
||||
if ( ( $tag->hasAttribute( 'href' ) and !$tag->hasAttribute( 'data-mentionid' ) AND !$tag->hasAttribute( 'data-fileid' ) ) OR ( ( $tag->hasAttribute( 'src' ) OR $tag->hasAttribute( 'data-embed-src' ) ) AND !$tag->hasAttribute( 'data-emoticon' ) AND !$tag->hasAttribute( 'data-fileid' ) ) )
|
||||
{
|
||||
if ( \IPS\Settings::i()->ipb_url_filter_option == 'none' )
|
||||
if ( \IPS\Settings::i()->ipb_url_filter_option == 'none' AND \IPS\Settings::i()->url_filter_action == 'allow' )
|
||||
{
|
||||
return $tag->hasAttribute( 'href' );
|
||||
}
|
||||
@@ -512,11 +512,19 @@ class _Profanity extends \IPS\Patterns\ActiveRecord implements \JsonSerializable
|
||||
}
|
||||
|
||||
/* IF we are moderating all URL's and it's not an attachment, return here. */
|
||||
if ( $good !== TRUE AND \IPS\Settings::i()->ipb_url_filter_option == 'none' )
|
||||
if ( $good !== TRUE )
|
||||
{
|
||||
return $good;
|
||||
if ( \IPS\Settings::i()->url_filter_any_action == 'moderate' )
|
||||
{
|
||||
return $urlToCheck;
|
||||
}
|
||||
|
||||
if ( \IPS\Settings::i()->ipb_url_filter_option == 'none' )
|
||||
{
|
||||
return $good;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$url = preg_quote( $url, '/' );
|
||||
$url = str_replace( '\*', "(.*?)", $url );
|
||||
|
||||
@@ -552,8 +560,7 @@ class _Profanity extends \IPS\Patterns\ActiveRecord implements \JsonSerializable
|
||||
return $good;
|
||||
}
|
||||
}
|
||||
catch( \Exception $e ) {}
|
||||
catch( \ValueError $e ) {}
|
||||
catch( \Exception | \ValueError $e ) {}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
Reference in new issue
Block a user