From a809e95ff1a42de556e25aa4a7d77d57437f37ae Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 28 May 2012 09:46:16 +0100 Subject: [PATCH] anonymous functions are php 5.3, shimmie aims for 5.2.6 --- ext/mass_tagger/main.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ext/mass_tagger/main.php b/ext/mass_tagger/main.php index f91c05a5..ff3d91d7 100644 --- a/ext/mass_tagger/main.php +++ b/ext/mass_tagger/main.php @@ -38,13 +38,11 @@ class MassTagger extends Extension { $ids = explode( ':', $_POST['ids'] ); $ids = array_filter ( $ids , 'is_numeric' ); - $ids = array_map( "Image::by_id", $ids ); + $images = array_map( "Image::by_id", $ids ); - $func = function( $image ) use ( $tag ) { - $tag .= " " . $image->get_tag_list(); - $image->set_tags( $tag ); - }; - array_walk( $ids, $func ); + foreach($images as $image) { + $image->set_tags($tag . " " . $image->get_tag_list()); + } $page->set_mode("redirect"); $page->set_redirect(make_link("post/list"));