Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -132,7 +132,7 @@ class _Follow
|
||||
$class = 'IPS\Member\Club';
|
||||
}
|
||||
|
||||
if ( !$class )
|
||||
if ( !$class or !array_key_exists( $args['app'], \IPS\Application::applications() ) )
|
||||
{
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'NOT_FOUND', 'GQL/0001/4', 404 );
|
||||
}
|
||||
@@ -150,19 +150,23 @@ class _Follow
|
||||
{
|
||||
if ( \in_array( 'IPS\Node\Model', class_parents( $class ) ) )
|
||||
{
|
||||
$thing = $class::loadAndCheckPerms( $args['id'] );
|
||||
$thing = $class::loadAndCheckPerms( (int) $args['id'] );
|
||||
}
|
||||
elseif ( $class == 'IPS\Member\Club' )
|
||||
{
|
||||
$thing = $class::loadAndCheckPerms( $args['id'] );
|
||||
$thing = $class::loadAndCheckPerms( (int) $args['id'] );
|
||||
}
|
||||
elseif ( $class != "IPS\Member" )
|
||||
{
|
||||
$thing = $class::loadAndCheckPerms( $args['id'] );
|
||||
$thing = $class::loadAndCheckPerms( (int) $args['id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$thing = $class::load( $args['id'] );
|
||||
if( !$class instanceof \IPS\Content\Followable )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
$thing = $class::load( (int) $args['id'] );
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
|
||||
@@ -65,10 +65,10 @@ class _SessionEnd
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'NOT_LOGGED_IN', 'GQL/0001/6', 403 );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( 'core_oauth_server_access_tokens', array( 'member_id=? AND access_token=?', \IPS\Member::loggedIn()->member_id, \IPS\Dispatcher::i()->accessToken['access_token'] ) );
|
||||
\IPS\Db::i()->update( 'core_oauth_server_access_tokens', array( 'status' => 'revoked' ), array( 'member_id=? AND access_token=?', \IPS\Member::loggedIn()->member_id, \IPS\Dispatcher::i()->accessToken['access_token'] ) );
|
||||
if ( isset( \IPS\Dispatcher::i()->accessToken['device_key'] ) )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_oauth_server_access_tokens', array( 'member_id=? AND device_key=?', \IPS\Member::loggedIn()->member_id, \IPS\Dispatcher::i()->accessToken['device_key'] ) );
|
||||
\IPS\Db::i()->update( 'core_oauth_server_access_tokens', array( 'status' => 'revoked' ), array( 'member_id=? AND device_key=?', \IPS\Member::loggedIn()->member_id, \IPS\Dispatcher::i()->accessToken['device_key'] ) );
|
||||
}
|
||||
|
||||
if ( isset( $args['token'] ) and $args['token'] )
|
||||
|
||||
@@ -116,6 +116,11 @@ class _Unfollow
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$class or !array_key_exists( $args['app'], \IPS\Application::applications() ) )
|
||||
{
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'NOT_FOUND', 'GQL/0001/7', 404 );
|
||||
}
|
||||
|
||||
/* Get our return info ready */
|
||||
$return = array(
|
||||
@@ -131,11 +136,11 @@ class _Unfollow
|
||||
{
|
||||
if ( $class != "IPS\Member" )
|
||||
{
|
||||
$thing = $class::loadAndCheckPerms( $follow['follow_rel_id'] );
|
||||
$thing = $class::loadAndCheckPerms( (int) $follow['follow_rel_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$thing = $class::load( $follow['follow_rel_id'] );
|
||||
$thing = $class::load( (int) $follow['follow_rel_id'] );
|
||||
}
|
||||
|
||||
/* Unfollow club areas */
|
||||
|
||||
@@ -116,7 +116,7 @@ class _UploadAttachment
|
||||
$file = \IPS\File::get( 'core_Attachment', $url );
|
||||
|
||||
/* If it's got an image extension, check it's actually a valid image */
|
||||
if ( \in_array( $ext, \IPS\Image::$imageExtensions ) )
|
||||
if ( \in_array( $ext, \IPS\Image::supportedExtensions() ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -142,7 +142,7 @@ class _UploadAttachment
|
||||
else
|
||||
{
|
||||
/* If it's got an image extension, check it's actually a valid image */
|
||||
if ( \in_array( $ext, \IPS\Image::$imageExtensions ) )
|
||||
if ( \in_array( $ext, \IPS\Image::supportedExtensions() ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user