From 226fdb558925c235c8cb60f33538488638d4aebd Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Mon, 13 Jun 2011 19:02:26 -0400 Subject: [PATCH] Fix IRC nick regex. Summary: Nicks can contain more characters than were allowed. The new regex is ugly, but should include most of them. Test Plan: Joined the bot as phabot-c0d`eb1^ock successfully. Reviewers: epriestley CC: Differential Revision: 453 --- src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php b/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php index 3fd7acb40f..6cc6ccaaf4 100644 --- a/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php +++ b/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php @@ -56,9 +56,9 @@ final class PhabricatorIRCBot extends PhabricatorDaemon { $nick = idx($config, 'nick', 'phabot'); - if (!preg_match('/^[A-Za-z0-9_]+$/', $nick)) { + if (!preg_match('/^[A-Za-z0-9_`[{}^|\]\\-]+$/', $nick)) { throw new Exception( - "Nickname '{$nick}' is invalid, must be alphanumeric!"); + "Nickname '{$nick}' is invalid!"); } if (!$join) {