X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fhomonymes.inc.php;h=93406c0a9770d39675cf164a47a6695536c06a86;hb=787bb3d745141f2f85bd947ad7dd775d2c63f908;hp=dd592f0d0e3f58562521a5e8bd85c8f0b04e5b0d;hpb=7568a515d7e3c4c992dd98b784165aa36b575ff9;p=platal.git diff --git a/include/homonymes.inc.php b/include/homonymes.inc.php index dd592f0..93406c0 100644 --- a/include/homonymes.inc.php +++ b/include/homonymes.inc.php @@ -57,7 +57,7 @@ function switch_bestalias($uid, $loginbis) { $res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", $uid); $bestalias = $res->fetchOneCell(); if ($bestalias && $bestalias != $loginbis) return false; - + // select the shortest alias still alive $res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND alias != {?} AND expire IS NULL ORDER BY LENGTH(alias) LIMIT 1", $uid, $loginbis); $newbest = $res->fetchOneCell();