From: Florent Bruneau Date: Wed, 6 Oct 2010 16:28:58 +0000 (+0200) Subject: Fix quick search shortcuts (admin:, profile:...) to support new login X-Git-Tag: xorg/1.0.1~87 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=251ac585fe00c1df930f634a2a11825098689e83;p=platal.git Fix quick search shortcuts (admin:, profile:...) to support new login patterns (.ax, .m2010, .d2009, .fx, ...). Signed-off-by: Florent Bruneau --- diff --git a/modules/search.php b/modules/search.php index 5d474f5..505e5ee 100644 --- a/modules/search.php +++ b/modules/search.php @@ -74,7 +74,9 @@ class SearchModule extends PLModule if (S::admin()) { $list .= '|admin|adm|ax'; } - if (preg_match('/^(' . $list . '):([-a-z]+(\.[-a-z]+(\.\d{2,4})?)?)$/', replace_accent($quick), $matches)) { + $suffixes = array_keys(DirEnum::getOptions(DirEnum::ACCOUNTTYPES)); + $suffixes = implode('|', $suffixes); + if (preg_match('/^(' . $list . '):([-a-z]+(\.[-a-z]+(\.(?:[md]?\d{2,4}|' . $suffixes . '))?)?)$/', replace_accent($quick), $matches)) { $login = $matches[2]; switch($matches[1]) { case 'admin': case 'adm':