Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,9 +11,15 @@
|
||||
namespace IPS\Content;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use Exception;
|
||||
use IPS\core\Reports\Report;
|
||||
use function defined;
|
||||
use function get_class;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -25,7 +31,7 @@ trait Reportable
|
||||
/**
|
||||
* Cached report data for checking if item has already been reported
|
||||
*/
|
||||
public $reportData = null;
|
||||
public array|null $reportData = null;
|
||||
|
||||
/**
|
||||
* Something has been moderated
|
||||
@@ -33,14 +39,14 @@ trait Reportable
|
||||
* @param string $method What just happened? A question I ask myself often
|
||||
* @return void
|
||||
*/
|
||||
public function moderated( $method )
|
||||
public function moderated( string $method ): void
|
||||
{
|
||||
/* If something has been moderated, we should lock down the index to prevent it from being auto_moderated again */
|
||||
try
|
||||
{
|
||||
$idColumn = static::$databaseColumnId;
|
||||
\IPS\core\Reports\Report::loadByClassAndId( \get_class( $this ), $this->$idColumn )->lockAutoModeration();
|
||||
Report::loadByClassAndId( get_class( $this ), $this->$idColumn )->lockAutoModeration();
|
||||
}
|
||||
catch( \Exception $e ) { }
|
||||
catch( Exception $e ) { }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user