Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

@@ -649,7 +649,7 @@ HTML,
$value AND
( $member = \IPS\Member::load( $value ) ) AND
$member->member_id AND
!$member->datalayer_collect_pii
$member->members_bitoptions['datalayer_pii_optout']
)
{
$piiProperties = array_merge( $piiProperties, $this->relatedPiiProperties( $propertyKey ) );
@@ -703,7 +703,7 @@ HTML,
)
{
$member = \IPS\Member::load( $originalID );
if ( $member->member_id AND !$member->datalayer_collect_pii )
if ( $member->member_id AND $member->members_bitoptions['datalayer_pii_optout'] )
{
$piiExcludes = array_merge( $piiExcludes, $this->relatedPiiProperties( $key ) );
continue;
@@ -892,7 +892,7 @@ HTML,
}
/* Logged In Member PII */
if ( \IPS\Settings::i()->core_datalayer_include_pii AND ( !\IPS\Settings::i()->core_datalayer_member_pii_choice OR \IPS\Member::loggedIn()->datalayer_collect_pii ) )
if ( \IPS\Settings::i()->core_datalayer_include_pii AND ( !\IPS\Settings::i()->core_datalayer_member_pii_choice OR !\IPS\Member::loggedIn()->members_bitoptions['datalayer_pii_optout'] ) )
{
if ( $properties['member_id']['enabled'] )
{
@@ -969,7 +969,7 @@ HTML,
)
{
$member = \IPS\Member::load( $originalId );
if ( !( $member->member_id AND $member->datalayer_collect_pii ) )
if ( !( $member->member_id AND !$member->members_bitoptions['datalayer_pii_optout'] ) )
{
$piiExcludes = array_merge( $piiExcludes, $this->relatedPiiProperties( $key ) );
continue;
@@ -91,6 +91,12 @@ class _Follow extends \IPS\Patterns\ActiveRecord
$name = $followed->name;
$url = $followed->url();
}
else if( $this->area == 'club' AND $this->app == 'core')
{
$followed = \IPS\Member\Club::load( $this->rel_id );
$name = $followed->name;
$url = $followed->url();
}
else
{
foreach( \IPS\Application::load( $this->app )->extensions( 'core', 'ContentRouter' ) as $key => $router )
@@ -171,4 +177,41 @@ class _Follow extends \IPS\Patterns\ActiveRecord
'followUrl' => (string) $url,
);
}
/**
* @var array[<string><string>] Special follow classes
*/
public static $specialFollowClasses = [
'core' => [
'member' => \IPS\Member::class,
'club' => \IPS\Member\Club::class,
],
];
/**
* Get the class to follow
*
* @param string $app Application key
* @param string $area Area
* @return string
* @throws \InvalidArgumentException
*/
public static function getClassToFollow(string $app, string $area): string
{
if( isset( static::$specialFollowClasses[$app][$area] ) )
{
$classToFollow = static::$specialFollowClasses[$app][$area];
}
else
{
$classToFollow = 'IPS\\' . $app . '\\' . mb_ucfirst( $area );
if( !class_exists( $classToFollow) or !array_key_exists( $app, \IPS\Application::applications() ) )
{
throw new \InvalidArgumentException;
}
}
return $classToFollow;
}
}
@@ -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;
@@ -258,7 +258,7 @@ class _Service extends \IPS\Node\Model
foreach( $loginHandlers as $handler )
{
$_key = mb_substr( \get_class( $handler ), 10 );
$_key = mb_substr( $handler['login_classname'], 10 );
if ( $_key == ucwords( $this->key ) )
{
+24 -1
View File
@@ -704,7 +704,28 @@ class _Stream extends \IPS\Node\Model
}
/* And dates */
if ( isset( $values['stream_date_type'] ) && $values['stream_date_type'] )
if ( isset( $values['stream_date_type'] ) )
{
/* If we're using last visit or relative, we need to reset some values. */
try
{
match( $values['stream_date_type'] ) {
'last_visit' => [
$values['stream_date_start'] = NULL,
$values['stream_date_end'] = NULL,
$values['stream_date_relative_days'] = NULL,
],
'relative' => [
$values['stream_date_start'] = NULL,
$values['stream_date_end'] = NULL,
]
};
}
catch( \UnhandledMatchError ) { }
}
/* If we're using custom dates, these need to be handled specially. */
if ( isset( $values['stream_date_type'] ) AND $values['stream_date_type'] AND $values['stream_date_type'] === 'custom' )
{
if ( ! isset( $values['stream_date_start'] ) )
{
@@ -715,6 +736,8 @@ class _Stream extends \IPS\Node\Model
{
$values['stream_date_end'] = isset( $values['stream_date_range'] ) && $values['stream_date_range']['end'] ? ( $values['stream_date_range']['end'] instanceof \IPS\DateTime ? $values['stream_date_range']['end']->getTimestamp() : $values['stream_date_range']['end'] ) : NULL;
}
$values['stream_date_relative_days'] = NULL;
}
unset( $values['stream_date_range'] );
@@ -43,6 +43,57 @@ class _Warning extends \IPS\Content\Item
* @brief Title
*/
public static $title = 'warning';
/**
* @return \DateInterval|null
*/
public function get_mq_interval()
{
if( $this->mq != -1 )
{
try
{
return new \DateInterval( $this->mq );
}
catch( \Exception $e ){}
}
return null;
}
/**
* @return \DateInterval|null
*/
public function get_rpa_interval()
{
if( $this->rpa != -1 )
{
try
{
return new \DateInterval( $this->rpa );
}
catch( \Exception $e ){}
}
return null;
}
/**
* @return \DateInterval|null
*/
public function get_suspend_interval()
{
if( $this->suspend != -1 )
{
try
{
return new \DateInterval( $this->suspend );
}
catch( \Exception $e ){}
}
return null;
}
/**
* Should posting this increment the poster's post count?