resolve negative aliases

This commit is contained in:
Shish 2013-08-04 18:19:23 +01:00
parent 2b628a395f
commit 8b22652aa0

View File

@ -1011,15 +1011,20 @@ class Tag {
public static function resolve_alias($tag) {
assert(is_string($tag));
$negative = false;
if(!empty($tag) && ($tag[0] == '-')) {
$negative = true;
$tag = substr($tag, 1);
}
global $database;
$newtag = $database->get_one(
$database->scoreql_to_sql("SELECT newtag FROM aliases WHERE SCORE_STRNORM(oldtag)=SCORE_STRNORM(:tag)"),
array("tag"=>$tag));
if(!empty($newtag)) {
return $newtag;
} else {
return $tag;
if(empty($newtag)) {
$newtag = $tag;
}
return $negative ? "-$newtag" : $newtag;
}
public static function resolve_wildcard($tag) {