From 251ac585fe00c1df930f634a2a11825098689e83 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 6 Oct 2010 18:28:58 +0200 Subject: [PATCH] Fix quick search shortcuts (admin:, profile:...) to support new login patterns (.ax, .m2010, .d2009, .fx, ...). Signed-off-by: Florent Bruneau --- modules/search.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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': -- 2.1.4