Commits

Anonymous committed 3f48b62

Spammers action: Improving logic

Comments (0)

Files changed (1)

elgg/actions/admin/user/spammer.php

 	
 	if($entities){	
 		for( $i = 0; $i <= $count; $i++){
-			if($entities[$i]->delete()){
+			if($i != $count && $entities[$i]->delete()){
 				error_log("ENTITY DELETED " . $entities[$i]->guid);
 			}else{
 				error_log("FAIL DELETING ENTITY " . $entities[$i]->guid);
 	
 	if($annotations){
 		for( $i = 0; $i <= $count; $i++){
-			if(delete_annotation($annotations[$i]->id)){
+			if($i != $count && delete_annotation($annotations[$i]->id)){
 				error_log("ANNOTATION DELETED " . $annotations[$i]->id);
 			}else{
 				error_log("FAIL DELETING ANNOTATION " . $annotations[$i]->id);