forked from Cavemanon/cavepaintings
Rewind arrays before foreach loops over all the elements.
(fixed a small typo as well)
This commit is contained in:
@@ -40,6 +40,9 @@ class Ratings implements Extension {
|
||||
while(true) {
|
||||
$images = Image::find_images($n, 100, Tag::explode($_POST["query"]));
|
||||
if(count($images) == 0) break;
|
||||
|
||||
reset($images); // rewind to first element in array.
|
||||
|
||||
foreach($images as $image) {
|
||||
send_event(new RatingSetEvent($image, $user, $_POST['rating']));
|
||||
}
|
||||
|
Reference in New Issue
Block a user