diff --git a/classes/actions/ActionMy.class.php b/classes/actions/ActionMy.class.php index 01516d05..04fbe422 100644 --- a/classes/actions/ActionMy.class.php +++ b/classes/actions/ActionMy.class.php @@ -37,9 +37,9 @@ class ActionMy extends Action { } protected function RegisterEvent() { - $this->AddEventPreg('/^[\w\-\_]+$/i','/^(page(\d+))?$/i','EventTopics'); - $this->AddEventPreg('/^[\w\-\_]+$/i','/^blog$/i','/^(page(\d+))?$/i','EventTopics'); - $this->AddEventPreg('/^[\w\-\_]+$/i','/^comment$/i','/^(page(\d+))?$/i','EventComments'); + $this->AddEventPreg('/^.+$/i','/^(page(\d+))?$/i','EventTopics'); + $this->AddEventPreg('/^.+$/i','/^blog$/i','/^(page(\d+))?$/i','EventTopics'); + $this->AddEventPreg('/^.+$/i','/^comment$/i','/^(page(\d+))?$/i','EventComments'); } diff --git a/classes/actions/ActionProfile.class.php b/classes/actions/ActionProfile.class.php index 37f3cb0e..1db9fc4a 100644 --- a/classes/actions/ActionProfile.class.php +++ b/classes/actions/ActionProfile.class.php @@ -42,9 +42,9 @@ class ActionProfile extends Action { $this->AddEvent('ajaxfrienddelete', 'EventAjaxFriendDelete'); $this->AddEvent('ajaxfriendaccept', 'EventAjaxFriendAccept'); - $this->AddEventPreg('/^[\w\-\_]+$/i','/^(whois)?$/i','EventWhois'); - $this->AddEventPreg('/^[\w\-\_]+$/i','/^favourites$/i','/^comments$/i','/^(page(\d+))?$/i','EventFavouriteComments'); - $this->AddEventPreg('/^[\w\-\_]+$/i','/^favourites$/i','/^(page(\d+))?$/i','EventFavourite'); + $this->AddEventPreg('/^.+$/i','/^(whois)?$/i','EventWhois'); + $this->AddEventPreg('/^.+$/i','/^favourites$/i','/^comments$/i','/^(page(\d+))?$/i','EventFavouriteComments'); + $this->AddEventPreg('/^.+$/i','/^favourites$/i','/^(page(\d+))?$/i','EventFavourite'); } /********************************************************************************** diff --git a/classes/actions/ActionRegistration.class.php b/classes/actions/ActionRegistration.class.php index b3d90d7a..1566abd8 100644 --- a/classes/actions/ActionRegistration.class.php +++ b/classes/actions/ActionRegistration.class.php @@ -76,7 +76,7 @@ class ActionRegistration extends Action { /** * Проверка логина */ - if (!func_check(getRequest('login'),'login',3,30)) { + if (!$this->User_CheckLogin(getRequest('login'))) { $this->Message_AddError($this->Lang_Get('registration_login_error'),$this->Lang_Get('error')); $bError=true; } diff --git a/classes/modules/user/User.class.php b/classes/modules/user/User.class.php index c94ae9c3..4179327b 100644 --- a/classes/modules/user/User.class.php +++ b/classes/modules/user/User.class.php @@ -1177,5 +1177,16 @@ class ModuleUser extends Module { public function DeleteFoto($oUser) { @unlink($this->Image_GetServerPath($oUser->getProfileFoto())); } + /** + * Проверяет логин на корректность + * + * @param unknown_type $sLogin + */ + public function CheckLogin($sLogin) { + if (preg_match("/^[\da-z\_\-]{".Config::Get('module.user.login.min_size').','.Config::Get('module.user.login.max_size')."}$/i",$sLogin)){ + return true; + } + return false; + } } ?> \ No newline at end of file diff --git a/config/config.php b/config/config.php index 8bbf2b2d..2b261b1d 100644 --- a/config/config.php +++ b/config/config.php @@ -164,6 +164,8 @@ $config['module']['user']['friend_notice']['delete'] = false; // Отправи $config['module']['user']['friend_notice']['accept'] = false; // Отправить talk-сообщение в случае одобрения заявки на добавление в друзья $config['module']['user']['friend_notice']['reject'] = false; // Отправить talk-сообщение в случае отклонения заявки на добавление в друзья $config['module']['user']['avatar_size'] = array(64,48,24,0); // Список размеров аватаров у пользователя. 0 - исходный размер +$config['module']['user']['login']['min_size'] = 3; // Минимальное количество символов в логине +$config['module']['user']['login']['max_size'] = 30; // Максимальное количество символов в логине // Модуль Comment $config['module']['comment']['per_page'] = 20; // Число комментариев на одну страницу(это касается только полного списка комментариев прямого эфира) $config['module']['comment']['bad'] = -5; // Рейтинг комментария, начиная с которого он будет скрыт