Rewind arrays before foreach loops over all the elements.

(fixed a small typo as well)
This commit is contained in:
green-ponies (jgen)
2012-02-04 15:35:21 -05:00
parent cd1f5d9ed0
commit 3b028696a0
7 changed files with 23 additions and 2 deletions

View File

@ -770,6 +770,8 @@ class Image {
}
}
reset($terms); // rewind to first element in array.
// turn each term into a specific type of querylet
foreach($terms as $term) {
$negative = false;
@ -1002,8 +1004,15 @@ class Tag {
}
}
/**
* This function takes a list (array) of tags and changes any tags that have aliases
*
* @param $tags Array of tags
* @return Array of tags
*/
public static function resolve_list($tags) {
$tags = Tag::explode($tags);
reset($tags); // rewind array to the first element.
$new = array();
foreach($tags as $tag) {
$new_set = explode(' ', Tag::resolve_alias($tag));