Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

+17 -11
View File
@@ -11,29 +11,35 @@
namespace IPS\Node\Api\GraphQL;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\Api\GraphQL\SafeException;
use IPS\Member;
use IPS\Node\Model;
use OutOfRangeException;
use function defined;
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;
}
/**
* @brief Base mutator class for nodes
*/
class _NodeMutator
class NodeMutator
{
/**
* Mark a node as read
*
* @param int $reactionID ID of reaction to add
* @param \IPS\Content\Comment $comment The comment to add a reaction on
* @return void
* @param Model $node The comment to add a reaction on
* @return Model
*/
protected function _markRead( $node )
protected function _markRead( Model $node ): Model
{
if( !\IPS\Member::loggedIn()->member_id )
if( !Member::loggedIn()->member_id )
{
throw new \IPS\Api\GraphQL\SafeException( 'NOT_LOGGED_IN', 'GQL/0004/1', 403 );
throw new SafeException( 'NOT_LOGGED_IN', 'GQL/0004/1', 403 );
}
try
@@ -41,9 +47,9 @@ class _NodeMutator
$itemClass = $node::$contentItemClass;
$itemClass::markContainerRead( $node );
}
catch ( \OutOfRangeException $e )
catch ( OutOfRangeException $e )
{
throw new \IPS\Api\GraphQL\SafeException( 'INVALID_NODE', 'GQL/0004/2', 403 );
throw new SafeException( 'INVALID_NODE', 'GQL/0004/2', 403 );
}
return $node;