use resolve_aliases rather than resolve_alias
This commit is contained in:
parent
b5f70de496
commit
c07dc2e0ab
1 changed files with 19 additions and 22 deletions
|
@ -666,6 +666,8 @@ class Image {
|
|||
}
|
||||
}
|
||||
|
||||
$terms = Tag::resolve_aliases($terms);
|
||||
|
||||
// parse the words that are searched for into
|
||||
// various types of querylet
|
||||
foreach($terms as $term) {
|
||||
|
@ -678,15 +680,6 @@ class Image {
|
|||
continue;
|
||||
}
|
||||
|
||||
$aliases = explode(" ", Tag::resolve_alias($term));
|
||||
$found = array_search($term, $aliases);
|
||||
if($found !== false){
|
||||
unset($aliases[$found]);
|
||||
}else{
|
||||
$term = array_shift($aliases);
|
||||
}
|
||||
foreach($aliases as $alias) array_push($terms, $alias);
|
||||
|
||||
$stpe = new SearchTermParseEvent($term, $terms);
|
||||
send_event($stpe);
|
||||
if($stpe->is_querylet_set()) {
|
||||
|
@ -834,6 +827,8 @@ class Image {
|
|||
}
|
||||
}
|
||||
|
||||
$terms = Tag::resolve_aliases($terms);
|
||||
|
||||
reset($terms); // rewind to first element in array.
|
||||
|
||||
// turn each term into a specific type of querylet
|
||||
|
@ -843,15 +838,6 @@ class Image {
|
|||
$negative = true;
|
||||
$term = substr($term, 1);
|
||||
}
|
||||
|
||||
$aliases = explode(" ", Tag::resolve_alias($term));
|
||||
$found = array_search($term, $aliases);
|
||||
if($found !== false){
|
||||
unset($aliases[$found]);
|
||||
}else{
|
||||
$term = array_shift($aliases);
|
||||
}
|
||||
foreach($aliases as $alias) array_push($terms, $alias);
|
||||
|
||||
$stpe = new SearchTermParseEvent($term, $terms);
|
||||
send_event($stpe);
|
||||
|
@ -1099,11 +1085,22 @@ class Tag {
|
|||
assert(is_array($tags));
|
||||
|
||||
$new = array();
|
||||
foreach($tags as $tag) {
|
||||
$new_set = explode(' ', Tag::resolve_alias($tag));
|
||||
foreach($new_set as $new_one) {
|
||||
$new[] = $new_one;
|
||||
|
||||
$i = 0;
|
||||
$tag_count = count($tags);
|
||||
while($i<$tag_count) {
|
||||
$aliases = explode(' ', Tag::resolve_alias($tags[$i]));
|
||||
foreach($aliases as $alias){
|
||||
if(!in_array($alias, $new)){
|
||||
if($tags[$i] == $alias){
|
||||
$new[] = $alias;
|
||||
}elseif(!in_array($alias, $tags)){
|
||||
$tags[] = $alias;
|
||||
$tag_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$new = array_iunique($new); // remove any duplicate tags
|
||||
|
|
Reference in a new issue