Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -533,9 +533,9 @@ class CommentController extends Controller
|
||||
try
|
||||
{
|
||||
$index = Report::loadByClassAndId( get_class( $object ), $object->$idColumn );
|
||||
$report = Db::i()->select( '*', 'core_rc_reports', array( 'rid=? and report_by=? and date_reported > ?', $index->id, $member, time() - ( Settings::i()->automoderation_report_again_mins * 60 ) ) )->first();
|
||||
$report = Db::i()->select( '*', 'core_rc_reports', ['rid=? and report_by=? and date_reported > ?', $index->id, $member->member_id, time() - ( Settings::i()->automoderation_report_again_mins * 60 )] )->first();
|
||||
|
||||
/* They have aleady reported, so do nothing */
|
||||
/* They have already reported, so do nothing */
|
||||
throw new Exception( 'REPORTED_ALREADY', '1S425/C', 404 );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
|
||||
@@ -231,10 +231,19 @@ class ItemController extends Controller
|
||||
$class = $this->class;
|
||||
|
||||
$item = $class::load( $id );
|
||||
if ( $this->member and !$item->can( 'read', $this->member ) )
|
||||
|
||||
if( $this->member )
|
||||
{
|
||||
throw new OutOfRangeException;
|
||||
if ( method_exists($item, 'canView') and !$item->canView( $this->member ) )
|
||||
{
|
||||
throw new OutOfRangeException;
|
||||
}
|
||||
else if ( !$item->can( 'read', $this->member ) )
|
||||
{
|
||||
throw new OutOfRangeException;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new Response( 200, $item->apiOutput( $this->member ) );
|
||||
}
|
||||
@@ -571,9 +580,16 @@ class ItemController extends Controller
|
||||
* @var Comment $commentClass */
|
||||
$itemClass = $this->class;
|
||||
$item = $itemClass::load( $id );
|
||||
if ( $this->member and !$item->can( 'read', $this->member ) )
|
||||
if( $this->member )
|
||||
{
|
||||
throw new OutOfRangeException;
|
||||
if ( method_exists($item, 'canView') and !$item->canView( $this->member ) )
|
||||
{
|
||||
throw new OutOfRangeException;
|
||||
}
|
||||
else if ( !$item->can( 'read', $this->member ) )
|
||||
{
|
||||
throw new OutOfRangeException;
|
||||
}
|
||||
}
|
||||
$itemIdColumn = $itemClass::$databaseColumnId;
|
||||
$where [] = array( $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['item'] . '=?', $item->$itemIdColumn );
|
||||
|
||||
Reference in new issue
Block a user