mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-28 20:45:00 +03:00
Security fix - потенциальная возможность раскрытия путей на сервере, уровень - низкий
This commit is contained in:
parent
ed3b86a3bd
commit
c2231cd3a1
|
@ -12,4 +12,8 @@ RewriteRule ^(.*)$ ./index.php
|
|||
order allow,deny
|
||||
deny from all
|
||||
</Files>
|
||||
<Files "plugin.xml">
|
||||
order allow,deny
|
||||
deny from all
|
||||
</Files>
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ class ActionAdmin extends Action {
|
|||
/**
|
||||
* Получаем название плагина и действие
|
||||
*/
|
||||
if($sPlugin=getRequest('plugin',null,'get') and $sAction=getRequest('action',null,'get')) {
|
||||
if($sPlugin=getRequestStr('plugin',null,'get') and $sAction=getRequestStr('action',null,'get')) {
|
||||
return $this->SubmitManagePlugin($sPlugin,$sAction);
|
||||
}
|
||||
/**
|
||||
|
@ -171,7 +171,7 @@ class ActionAdmin extends Action {
|
|||
*/
|
||||
protected function EventUserFields()
|
||||
{
|
||||
switch(getRequest('action')) {
|
||||
switch(getRequestStr('action')) {
|
||||
/**
|
||||
* Создание нового поля
|
||||
*/
|
||||
|
@ -184,11 +184,11 @@ class ActionAdmin extends Action {
|
|||
return;
|
||||
}
|
||||
$oField = Engine::GetEntity('User_Field');
|
||||
$oField->setName(getRequest('name'));
|
||||
$oField->setTitle(getRequest('title'));
|
||||
$oField->setPattern(getRequest('pattern'));
|
||||
if (in_array(getRequest('type'),$this->User_GetUserFieldTypes())) {
|
||||
$oField->setType(getRequest('type'));
|
||||
$oField->setName(getRequestStr('name'));
|
||||
$oField->setTitle(getRequestStr('title'));
|
||||
$oField->setPattern(getRequestStr('pattern'));
|
||||
if (in_array(getRequestStr('type'),$this->User_GetUserFieldTypes())) {
|
||||
$oField->setType(getRequestStr('type'));
|
||||
} else {
|
||||
$oField->setType('');
|
||||
}
|
||||
|
@ -214,11 +214,11 @@ class ActionAdmin extends Action {
|
|||
* Обрабатываем как ajax запрос (json)
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
if (!getRequest('id')) {
|
||||
if (!getRequestStr('id')) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
$this->User_deleteUserField(getRequest('id'));
|
||||
$this->User_deleteUserField(getRequestStr('id'));
|
||||
$this->Message_AddNotice($this->Lang_Get('user_field_deleted'),$this->Lang_Get('attention'));
|
||||
break;
|
||||
/**
|
||||
|
@ -229,11 +229,11 @@ class ActionAdmin extends Action {
|
|||
* Обрабатываем как ajax запрос (json)
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
if (!getRequest('id')) {
|
||||
if (!getRequestStr('id')) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
if (!$this->User_userFieldExistsById(getRequest('id'))) {
|
||||
if (!$this->User_userFieldExistsById(getRequestStr('id'))) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return false;
|
||||
}
|
||||
|
@ -241,12 +241,12 @@ class ActionAdmin extends Action {
|
|||
return;
|
||||
}
|
||||
$oField = Engine::GetEntity('User_Field');
|
||||
$oField->setId(getRequest('id'));
|
||||
$oField->setName(getRequest('name'));
|
||||
$oField->setTitle(getRequest('title'));
|
||||
$oField->setPattern(getRequest('pattern'));
|
||||
if (in_array(getRequest('type'),$this->User_GetUserFieldTypes())) {
|
||||
$oField->setType(getRequest('type'));
|
||||
$oField->setId(getRequestStr('id'));
|
||||
$oField->setName(getRequestStr('name'));
|
||||
$oField->setTitle(getRequestStr('title'));
|
||||
$oField->setPattern(getRequestStr('pattern'));
|
||||
if (in_array(getRequestStr('type'),$this->User_GetUserFieldTypes())) {
|
||||
$oField->setType(getRequestStr('type'));
|
||||
} else {
|
||||
$oField->setType('');
|
||||
}
|
||||
|
@ -280,18 +280,18 @@ class ActionAdmin extends Action {
|
|||
*/
|
||||
public function checkUserField()
|
||||
{
|
||||
if (!getRequest('title')) {
|
||||
if (!getRequestStr('title')) {
|
||||
$this->Message_AddError($this->Lang_Get('user_field_error_add_no_title'),$this->Lang_Get('error'));
|
||||
return false;
|
||||
}
|
||||
if (!getRequest('name')) {
|
||||
if (!getRequestStr('name')) {
|
||||
$this->Message_AddError($this->Lang_Get('user_field_error_add_no_name'),$this->Lang_Get('error'));
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Не допускаем дубликатов по имени
|
||||
*/
|
||||
if ($this->User_userFieldExistsByName(getRequest('name'), getRequest('id'))) {
|
||||
if ($this->User_userFieldExistsByName(getRequestStr('name'), getRequestStr('id'))) {
|
||||
$this->Message_AddError($this->Lang_Get('user_field_error_name_exists'),$this->Lang_Get('error'));
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ class ActionAjax extends Action {
|
|||
* Получение списка регионов по стране
|
||||
*/
|
||||
protected function EventGeoGetRegions() {
|
||||
$iCountryId=getRequest('country');
|
||||
$iCountryId=getRequestStr('country');
|
||||
$iLimit=200;
|
||||
if (is_numeric(getRequest('limit')) and getRequest('limit')>0) {
|
||||
$iLimit=getRequest('limit');
|
||||
|
@ -156,7 +156,7 @@ class ActionAjax extends Action {
|
|||
* Получение списка городов по региону
|
||||
*/
|
||||
protected function EventGeoGetCities() {
|
||||
$iRegionId=getRequest('region');
|
||||
$iRegionId=getRequestStr('region');
|
||||
$iLimit=500;
|
||||
if (is_numeric(getRequest('limit')) and getRequest('limit')>0) {
|
||||
$iLimit=getRequest('limit');
|
||||
|
@ -199,7 +199,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Комментарий существует?
|
||||
*/
|
||||
if (!($oComment=$this->Comment_GetCommentById(getRequest('idComment',null,'post')))) {
|
||||
if (!($oComment=$this->Comment_GetCommentById(getRequestStr('idComment',null,'post')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('comment_vote_error_noexists'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Как именно голосует пользователь
|
||||
*/
|
||||
$iValue=getRequest('value',null,'post');
|
||||
$iValue=getRequestStr('value',null,'post');
|
||||
if (!in_array($iValue,array('1','-1'))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('comment_vote_error_value'),$this->Lang_Get('attention'));
|
||||
return;
|
||||
|
@ -279,7 +279,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Топик существует?
|
||||
*/
|
||||
if (!($oTopic=$this->Topic_GetTopicById(getRequest('idTopic',null,'post')))) {
|
||||
if (!($oTopic=$this->Topic_GetTopicById(getRequestStr('idTopic',null,'post')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Как проголосовал пользователь
|
||||
*/
|
||||
$iValue=getRequest('value',null,'post');
|
||||
$iValue=getRequestStr('value',null,'post');
|
||||
if (!in_array($iValue,array('1','-1','0'))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('attention'));
|
||||
return;
|
||||
|
@ -372,7 +372,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Блог существует?
|
||||
*/
|
||||
if (!($oBlog=$this->Blog_GetBlogById(getRequest('idBlog',null,'post')))) {
|
||||
if (!($oBlog=$this->Blog_GetBlogById(getRequestStr('idBlog',null,'post')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ class ActionAjax extends Action {
|
|||
*/
|
||||
switch($this->ACL_CanVoteBlog($this->oUserCurrent,$oBlog)) {
|
||||
case ModuleACL::CAN_VOTE_BLOG_TRUE:
|
||||
$iValue=getRequest('value',null,'post');
|
||||
$iValue=getRequestStr('value',null,'post');
|
||||
if (in_array($iValue,array('1','-1'))) {
|
||||
$oBlogVote=Engine::GetEntity('Vote');
|
||||
$oBlogVote->setTargetId($oBlog->getId());
|
||||
|
@ -450,7 +450,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Пользователь существует?
|
||||
*/
|
||||
if (!($oUser=$this->User_GetUserById(getRequest('idUser',null,'post')))) {
|
||||
if (!($oUser=$this->User_GetUserById(getRequestStr('idUser',null,'post')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -478,7 +478,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Как проголосовал
|
||||
*/
|
||||
$iValue=getRequest('value',null,'post');
|
||||
$iValue=getRequestStr('value',null,'post');
|
||||
if (!in_array($iValue,array('1','-1'))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('attention'));
|
||||
return;
|
||||
|
@ -525,8 +525,8 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Параметры голосования
|
||||
*/
|
||||
$idAnswer=getRequest('idAnswer',null,'post');
|
||||
$idTopic=getRequest('idTopic',null,'post');
|
||||
$idAnswer=getRequestStr('idAnswer',null,'post');
|
||||
$idTopic=getRequestStr('idTopic',null,'post');
|
||||
/**
|
||||
* Топик существует?
|
||||
*/
|
||||
|
@ -596,11 +596,11 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Объект уже должен быть в избранном
|
||||
*/
|
||||
if ($oFavourite=$this->Favourite_GetFavourite(getRequest('target_id'),getRequest('target_type'),$this->oUserCurrent->getId())) {
|
||||
if ($oFavourite=$this->Favourite_GetFavourite(getRequestStr('target_id'),getRequestStr('target_type'),$this->oUserCurrent->getId())) {
|
||||
/**
|
||||
* Обрабатываем теги
|
||||
*/
|
||||
$aTags=explode(',',trim((string)getRequest('tags'),"\r\n\t\0\x0B ."));
|
||||
$aTags=explode(',',trim(getRequestStr('tags'),"\r\n\t\0\x0B ."));
|
||||
$aTagsNew=array();
|
||||
$aTagsNewLow=array();
|
||||
$aTagsReturn=array();
|
||||
|
@ -642,7 +642,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Можно только добавить или удалить из избранного
|
||||
*/
|
||||
$iType=getRequest('type',null,'post');
|
||||
$iType=getRequestStr('type',null,'post');
|
||||
if (!in_array($iType,array('1','0'))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -650,7 +650,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Топик существует?
|
||||
*/
|
||||
if (!($oTopic=$this->Topic_GetTopicById(getRequest('idTopic',null,'post')))) {
|
||||
if (!($oTopic=$this->Topic_GetTopicById(getRequestStr('idTopic',null,'post')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -719,7 +719,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Можно только добавить или удалить из избранного
|
||||
*/
|
||||
$iType=getRequest('type',null,'post');
|
||||
$iType=getRequestStr('type',null,'post');
|
||||
if (!in_array($iType,array('1','0'))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -727,7 +727,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Комментарий существует?
|
||||
*/
|
||||
if (!($oComment=$this->Comment_GetCommentById(getRequest('idComment',null,'post')))) {
|
||||
if (!($oComment=$this->Comment_GetCommentById(getRequestStr('idComment',null,'post')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Можно только добавить или удалить из избранного
|
||||
*/
|
||||
$iType=getRequest('type',null,'post');
|
||||
$iType=getRequestStr('type',null,'post');
|
||||
if (!in_array($iType,array('1','0'))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -797,7 +797,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Сообщение существует?
|
||||
*/
|
||||
if (!($oTalk=$this->Talk_GetTalkById(getRequest('idTalk',null,'post')))) {
|
||||
if (!($oTalk=$this->Talk_GetTalkById(getRequestStr('idTalk',null,'post')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -965,7 +965,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Допустимый тип топика?
|
||||
*/
|
||||
if (!$this->Topic_IsAllowTopicType($sType=getRequest('topic_type'))) {
|
||||
if (!$this->Topic_IsAllowTopicType($sType=getRequestStr('topic_type'))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('topic_create_type_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -975,9 +975,9 @@ class ActionAjax extends Action {
|
|||
$oTopic=Engine::GetEntity('ModuleTopic_EntityTopic');
|
||||
$oTopic->_setValidateScenario($sType); // зависит от типа топика
|
||||
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
|
||||
$oTopic->setUserId($this->oUserCurrent->getId());
|
||||
$oTopic->setType($sType);
|
||||
|
@ -1023,7 +1023,7 @@ class ActionAjax extends Action {
|
|||
*
|
||||
*/
|
||||
protected function EventPreviewText() {
|
||||
$sText=(string)getRequest('text',null,'post');
|
||||
$sText=getRequestStr('text',null,'post');
|
||||
$bSave=getRequest('save',null,'post');
|
||||
/**
|
||||
* Экранировать или нет HTML теги
|
||||
|
@ -1163,7 +1163,7 @@ class ActionAjax extends Action {
|
|||
/**
|
||||
* Комментарий существует?
|
||||
*/
|
||||
$idComment=getRequest('idComment',null,'post');
|
||||
$idComment=getRequestStr('idComment',null,'post');
|
||||
if (!($oComment=$this->Comment_GetCommentById($idComment))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
|
|
@ -198,16 +198,16 @@ class ActionBlog extends Action {
|
|||
*/
|
||||
$oBlog=Engine::GetEntity('Blog');
|
||||
$oBlog->setOwnerId($this->oUserCurrent->getId());
|
||||
$oBlog->setTitle(strip_tags(getRequest('blog_title')));
|
||||
$oBlog->setTitle(strip_tags(getRequestStr('blog_title')));
|
||||
/**
|
||||
* Парсим текст на предмет разных ХТМЛ тегов
|
||||
*/
|
||||
$sText=$this->Text_Parser(getRequest('blog_description'));
|
||||
$sText=$this->Text_Parser(getRequestStr('blog_description'));
|
||||
$oBlog->setDescription($sText);
|
||||
$oBlog->setType(getRequest('blog_type'));
|
||||
$oBlog->setType(getRequestStr('blog_type'));
|
||||
$oBlog->setDateAdd(date("Y-m-d H:i:s"));
|
||||
$oBlog->setLimitRatingTopic(getRequest('blog_limit_rating_topic'));
|
||||
$oBlog->setUrl((string)getRequest('blog_url'));
|
||||
$oBlog->setLimitRatingTopic(getRequestStr('blog_limit_rating_topic'));
|
||||
$oBlog->setUrl(getRequestStr('blog_url'));
|
||||
$oBlog->setAvatar(null);
|
||||
/**
|
||||
* Загрузка аватара, делаем ресайзы
|
||||
|
@ -299,23 +299,23 @@ class ActionBlog extends Action {
|
|||
if (!$this->checkBlogFields($oBlog)) {
|
||||
return false;
|
||||
}
|
||||
$oBlog->setTitle(strip_tags(getRequest('blog_title')));
|
||||
$oBlog->setTitle(strip_tags(getRequestStr('blog_title')));
|
||||
/**
|
||||
* Парсим описание блога на предмет ХТМЛ тегов
|
||||
*/
|
||||
$sText=$this->Text_Parser(getRequest('blog_description'));
|
||||
$sText=$this->Text_Parser(getRequestStr('blog_description'));
|
||||
$oBlog->setDescription($sText);
|
||||
/**
|
||||
* Сбрасываем кеш, если поменяли тип блога
|
||||
* Нужна доработка, т.к. в этом блоге могут быть топики других юзеров
|
||||
*/
|
||||
if ($oBlog->getType()!=getRequest('blog_type')) {
|
||||
if ($oBlog->getType()!=getRequestStr('blog_type')) {
|
||||
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("topic_update_user_{$oBlog->getOwnerId()}"));
|
||||
}
|
||||
$oBlog->setType(getRequest('blog_type'));
|
||||
$oBlog->setLimitRatingTopic(getRequest('blog_limit_rating_topic'));
|
||||
$oBlog->setType(getRequestStr('blog_type'));
|
||||
$oBlog->setLimitRatingTopic(getRequestStr('blog_limit_rating_topic'));
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$oBlog->setUrl((string)getRequest('blog_url')); // разрешаем смену URL блога только админу
|
||||
$oBlog->setUrl(getRequestStr('blog_url')); // разрешаем смену URL блога только админу
|
||||
}
|
||||
/**
|
||||
* Загрузка аватара, делаем ресайзы
|
||||
|
@ -399,6 +399,7 @@ class ActionBlog extends Action {
|
|||
$aUserRank=array();
|
||||
}
|
||||
foreach ($aUserRank as $sUserId => $sRank) {
|
||||
$sRank=(string)$sRank;
|
||||
if (!($oBlogUser=$this->Blog_GetBlogUserByBlogIdAndUserId($oBlog->getId(),$sUserId))) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
break;
|
||||
|
@ -498,14 +499,14 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Проверяем есть ли название блога
|
||||
*/
|
||||
if (!func_check(getRequest('blog_title'),'text',2,200)) {
|
||||
if (!func_check(getRequestStr('blog_title'),'text',2,200)) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_title_error'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
} else {
|
||||
/**
|
||||
* Проверяем есть ли уже блог с таким названием
|
||||
*/
|
||||
if ($oBlogExists=$this->Blog_GetBlogByTitle(getRequest('blog_title'))) {
|
||||
if ($oBlogExists=$this->Blog_GetBlogByTitle(getRequestStr('blog_title'))) {
|
||||
if (!$oBlog or $oBlog->getId()!=$oBlogExists->getId()) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_title_error_unique'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
|
@ -517,9 +518,9 @@ class ActionBlog extends Action {
|
|||
* Проверяем есть ли URL блога, с заменой всех пробельных символов на "_"
|
||||
*/
|
||||
if (!$oBlog or $this->oUserCurrent->isAdministrator()) {
|
||||
$blogUrl=preg_replace("/\s+/",'_',(string)getRequest('blog_url'));
|
||||
$blogUrl=preg_replace("/\s+/",'_',getRequestStr('blog_url'));
|
||||
$_REQUEST['blog_url']=$blogUrl;
|
||||
if (!func_check(getRequest('blog_url'),'login',2,50)) {
|
||||
if (!func_check(getRequestStr('blog_url'),'login',2,50)) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_url_error'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
}
|
||||
|
@ -527,14 +528,14 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Проверяем на счет плохих УРЛов
|
||||
*/
|
||||
if (in_array(getRequest('blog_url'),$this->aBadBlogUrl)) {
|
||||
if (in_array(getRequestStr('blog_url'),$this->aBadBlogUrl)) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_url_error_badword').' '.join(',',$this->aBadBlogUrl),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
}
|
||||
/**
|
||||
* Проверяем есть ли уже блог с таким URL
|
||||
*/
|
||||
if ($oBlogExists=$this->Blog_GetBlogByUrl((string)getRequest('blog_url'))) {
|
||||
if ($oBlogExists=$this->Blog_GetBlogByUrl(getRequestStr('blog_url'))) {
|
||||
if (!$oBlog or $oBlog->getId()!=$oBlogExists->getId()) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_url_error_unique'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
|
@ -543,21 +544,21 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Проверяем есть ли описание блога
|
||||
*/
|
||||
if (!func_check(getRequest('blog_description'),'text',10,3000)) {
|
||||
if (!func_check(getRequestStr('blog_description'),'text',10,3000)) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_description_error'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
}
|
||||
/**
|
||||
* Проверяем доступные типы блога для создания
|
||||
*/
|
||||
if (!in_array(getRequest('blog_type'),array('open','close'))) {
|
||||
if (!in_array(getRequestStr('blog_type'),array('open','close'))) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_type_error'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
}
|
||||
/**
|
||||
* Преобразуем ограничение по рейтингу в число
|
||||
*/
|
||||
if (!func_check(getRequest('blog_limit_rating_topic'),'float')) {
|
||||
if (!func_check(getRequestStr('blog_limit_rating_topic'),'float')) {
|
||||
$this->Message_AddError($this->Lang_Get('blog_create_rating_error'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
}
|
||||
|
@ -573,8 +574,8 @@ class ActionBlog extends Action {
|
|||
*/
|
||||
protected function EventTopics() {
|
||||
$sPeriod=1; // по дефолту 1 день
|
||||
if (in_array(getRequest('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequest('period');
|
||||
if (in_array(getRequestStr('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequestStr('period');
|
||||
}
|
||||
$sShowType=$this->sCurrentEvent;
|
||||
if (!in_array($sShowType,array('discussed','top'))) {
|
||||
|
@ -812,8 +813,8 @@ class ActionBlog extends Action {
|
|||
*/
|
||||
protected function EventShowBlog() {
|
||||
$sPeriod=1; // по дефолту 1 день
|
||||
if (in_array(getRequest('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequest('period');
|
||||
if (in_array(getRequestStr('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequestStr('period');
|
||||
}
|
||||
$sBlogUrl=$this->sCurrentEvent;
|
||||
$sShowType=in_array($this->GetParamEventMatch(0,0),array('bad','new','newall','discussed','top')) ? $this->GetParamEventMatch(0,0) : 'good';
|
||||
|
@ -959,7 +960,7 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Проверяем топик
|
||||
*/
|
||||
if (!($oTopic=$this->Topic_GetTopicById(getRequest('cmt_target_id')))) {
|
||||
if (!($oTopic=$this->Topic_GetTopicById(getRequestStr('cmt_target_id')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -994,7 +995,7 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Проверяем текст комментария
|
||||
*/
|
||||
$sText=$this->Text_Parser(getRequest('comment_text'));
|
||||
$sText=$this->Text_Parser(getRequestStr('comment_text'));
|
||||
if (!func_check($sText,'text',2,10000)) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('topic_comment_add_text_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -1123,14 +1124,14 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Топик существует?
|
||||
*/
|
||||
$idTopic=getRequest('idTarget',null,'post');
|
||||
$idTopic=getRequestStr('idTarget',null,'post');
|
||||
if (!($oTopic=$this->Topic_GetTopicById($idTopic))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
||||
$idCommentLast=getRequest('idCommentLast',null,'post');
|
||||
$selfIdComment=getRequest('selfIdComment',null,'post');
|
||||
$idCommentLast=getRequestStr('idCommentLast',null,'post');
|
||||
$selfIdComment=getRequestStr('selfIdComment',null,'post');
|
||||
$aComments=array();
|
||||
/**
|
||||
* Если используется постраничность, возвращаем только добавленный комментарий
|
||||
|
@ -1190,7 +1191,7 @@ class ActionBlog extends Action {
|
|||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUsers=getRequest('users',null,'post');
|
||||
$sBlogId=getRequest('idBlog',null,'post');
|
||||
$sBlogId=getRequestStr('idBlog',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -1336,8 +1337,8 @@ class ActionBlog extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUserId=getRequest('idUser',null,'post');
|
||||
$sBlogId=getRequest('idBlog',null,'post');
|
||||
$sUserId=getRequestStr('idUser',null,'post');
|
||||
$sBlogId=getRequestStr('idBlog',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -1386,8 +1387,8 @@ class ActionBlog extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUserId=getRequest('idUser',null,'post');
|
||||
$sBlogId=getRequest('idBlog',null,'post');
|
||||
$sUserId=getRequestStr('idUser',null,'post');
|
||||
$sBlogId=getRequestStr('idBlog',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -1488,7 +1489,7 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Получаем код подтверждения из ревеста и дешефруем его
|
||||
*/
|
||||
$sCode=xxtea_decrypt(base64_decode(rawurldecode((string)getRequest('code'))), Config::Get('module.blog.encrypt'));
|
||||
$sCode=xxtea_decrypt(base64_decode(rawurldecode(getRequestStr('code'))), Config::Get('module.blog.encrypt'));
|
||||
if (!$sCode) {
|
||||
return $this->EventNotFound();
|
||||
}
|
||||
|
@ -1602,7 +1603,7 @@ class ActionBlog extends Action {
|
|||
*
|
||||
* (-1) - выбран пункт меню "удалить топики".
|
||||
*/
|
||||
if($sBlogIdNew=getRequest('topic_move_to') and ($sBlogIdNew!=-1) and is_array($aTopics) and count($aTopics)) {
|
||||
if($sBlogIdNew=getRequestStr('topic_move_to') and ($sBlogIdNew!=-1) and is_array($aTopics) and count($aTopics)) {
|
||||
if(!$oBlogNew = $this->Blog_GetBlogById($sBlogIdNew)){
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('blog_admin_delete_move_error'),$this->Lang_Get('error'),true);
|
||||
Router::Location($oBlog->getUrlFull());
|
||||
|
@ -1644,7 +1645,7 @@ class ActionBlog extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sBlogId=getRequest('idBlog',null,'post');
|
||||
$sBlogId=getRequestStr('idBlog',null,'post');
|
||||
/**
|
||||
* Определяем тип блога и получаем его
|
||||
*/
|
||||
|
@ -1682,7 +1683,7 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Блог существует?
|
||||
*/
|
||||
$idBlog=getRequest('idBlog',null,'post');
|
||||
$idBlog=getRequestStr('idBlog',null,'post');
|
||||
if (!($oBlog=$this->Blog_GetBlogById($idBlog))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
|
|
@ -58,7 +58,7 @@ class ActionBlogs extends Action {
|
|||
/**
|
||||
* Получаем из реквеста первые буквы блога
|
||||
*/
|
||||
if ($sTitle=getRequest('blog_title') and is_string($sTitle)) {
|
||||
if ($sTitle=getRequestStr('blog_title')) {
|
||||
$sTitle=str_replace('%','',$sTitle);
|
||||
}
|
||||
if (!$sTitle) {
|
||||
|
@ -87,14 +87,14 @@ class ActionBlogs extends Action {
|
|||
*/
|
||||
$sOrder='blog_rating';
|
||||
if (getRequest('order')) {
|
||||
$sOrder=(string)getRequest('order');
|
||||
$sOrder=getRequestStr('order');
|
||||
}
|
||||
/**
|
||||
* В каком направлении сортировать
|
||||
*/
|
||||
$sOrderWay='desc';
|
||||
if (getRequest('order_way')) {
|
||||
$sOrderWay=(string)getRequest('order_way');
|
||||
$sOrderWay=getRequestStr('order_way');
|
||||
}
|
||||
/**
|
||||
* Фильтр поиска блогов
|
||||
|
|
|
@ -94,8 +94,8 @@ class ActionIndex extends Action {
|
|||
*/
|
||||
protected function EventTop() {
|
||||
$sPeriod=1; // по дефолту 1 день
|
||||
if (in_array(getRequest('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequest('period');
|
||||
if (in_array(getRequestStr('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequestStr('period');
|
||||
}
|
||||
/**
|
||||
* Меню
|
||||
|
@ -145,8 +145,8 @@ class ActionIndex extends Action {
|
|||
*/
|
||||
protected function EventDiscussed() {
|
||||
$sPeriod=1; // по дефолту 1 день
|
||||
if (in_array(getRequest('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequest('period');
|
||||
if (in_array(getRequestStr('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequestStr('period');
|
||||
}
|
||||
/**
|
||||
* Меню
|
||||
|
|
|
@ -219,13 +219,13 @@ class ActionLink extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserId($this->oUserCurrent->getId());
|
||||
$oTopic->setType('link');
|
||||
$oTopic->setLinkUrl(getRequest('topic_link_url'));
|
||||
$oTopic->setLinkUrl(getRequestStr('topic_link_url'));
|
||||
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
|
||||
$oTopic->setUserIp(func_getIp());
|
||||
/**
|
||||
|
@ -347,11 +347,11 @@ class ActionLink extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setLinkUrl(getRequest('topic_link_url'));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setLinkUrl(getRequestStr('topic_link_url'));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserIp(func_getIp());
|
||||
/**
|
||||
* Проверка корректности полей формы
|
||||
|
|
|
@ -87,8 +87,8 @@ class ActionLogin extends Action {
|
|||
* Определяем редирект
|
||||
*/
|
||||
$sUrl=Config::Get('module.user.redirect_after_login');
|
||||
if (getRequest('return-path')) {
|
||||
$sUrl=getRequest('return-path');
|
||||
if (getRequestStr('return-path')) {
|
||||
$sUrl=getRequestStr('return-path');
|
||||
}
|
||||
$this->Viewer_AssignAjax('sUrlRedirect',$sUrl ? $sUrl : Config::Get('path.root.web'));
|
||||
return;
|
||||
|
@ -112,7 +112,7 @@ class ActionLogin extends Action {
|
|||
protected function EventAjaxReactivation() {
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
|
||||
if ((func_check(getRequest('mail'), 'mail') and $oUser = $this->User_GetUserByMail(getRequest('mail')))) {
|
||||
if ((func_check(getRequestStr('mail'), 'mail') and $oUser = $this->User_GetUserByMail(getRequestStr('mail')))) {
|
||||
if ($oUser->getActivate()) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('registration_activate_error_reactivate'));
|
||||
return;
|
||||
|
@ -162,7 +162,7 @@ class ActionLogin extends Action {
|
|||
/**
|
||||
* Пользователь с таким емайлом существует?
|
||||
*/
|
||||
if ((func_check(getRequest('mail'),'mail') and $oUser=$this->User_GetUserByMail(getRequest('mail')))) {
|
||||
if ((func_check(getRequestStr('mail'),'mail') and $oUser=$this->User_GetUserByMail(getRequestStr('mail')))) {
|
||||
/**
|
||||
* Формируем и отправляем ссылку на смену пароля
|
||||
*/
|
||||
|
|
|
@ -236,14 +236,14 @@ class ActionPeople extends Action {
|
|||
*/
|
||||
$sOrder='user_rating';
|
||||
if (getRequest('order')) {
|
||||
$sOrder=(string)getRequest('order');
|
||||
$sOrder=getRequestStr('order');
|
||||
}
|
||||
/**
|
||||
* В каком направлении сортировать
|
||||
*/
|
||||
$sOrderWay='desc';
|
||||
if (getRequest('order_way')) {
|
||||
$sOrderWay=(string)getRequest('order_way');
|
||||
$sOrderWay=getRequestStr('order_way');
|
||||
}
|
||||
$aFilter=array(
|
||||
'activate' => 1
|
||||
|
|
|
@ -74,8 +74,8 @@ class ActionPersonalBlog extends Action {
|
|||
*/
|
||||
protected function EventTopics() {
|
||||
$sPeriod=1; // по дефолту 1 день
|
||||
if (in_array(getRequest('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequest('period');
|
||||
if (in_array(getRequestStr('period'),array(1,7,30,'all'))) {
|
||||
$sPeriod=getRequestStr('period');
|
||||
}
|
||||
$sShowType=$this->sCurrentEvent;
|
||||
if (!in_array($sShowType,array('discussed','top'))) {
|
||||
|
|
|
@ -97,7 +97,7 @@ class ActionPhotoset extends Action {
|
|||
/**
|
||||
* Существует ли топик
|
||||
*/
|
||||
$oTopic = $this->Topic_getTopicById(getRequest('topic_id'));
|
||||
$oTopic = $this->Topic_getTopicById(getRequestStr('topic_id'));
|
||||
if (!$oTopic || !getRequest('last_id')) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
|
||||
return false;
|
||||
|
@ -105,7 +105,7 @@ class ActionPhotoset extends Action {
|
|||
/**
|
||||
* Получаем список фото
|
||||
*/
|
||||
$aPhotos = $oTopic->getPhotosetPhotos(getRequest('last_id'), Config::Get('module.topic.photoset.per_page'));
|
||||
$aPhotos = $oTopic->getPhotosetPhotos(getRequestStr('last_id'), Config::Get('module.topic.photoset.per_page'));
|
||||
$aResult = array();
|
||||
if (count($aPhotos)) {
|
||||
/**
|
||||
|
@ -137,7 +137,7 @@ class ActionPhotoset extends Action {
|
|||
/**
|
||||
* Поиск фото по id
|
||||
*/
|
||||
$oPhoto = $this->Topic_getTopicPhotoById(getRequest('id'));
|
||||
$oPhoto = $this->Topic_getTopicPhotoById(getRequestStr('id'));
|
||||
if ($oPhoto) {
|
||||
if ($oPhoto->getTopicId()) {
|
||||
/**
|
||||
|
@ -188,16 +188,16 @@ class ActionPhotoset extends Action {
|
|||
/**
|
||||
* Поиск фото по id
|
||||
*/
|
||||
$oPhoto = $this->Topic_getTopicPhotoById(getRequest('id'));
|
||||
$oPhoto = $this->Topic_getTopicPhotoById(getRequestStr('id'));
|
||||
if ($oPhoto) {
|
||||
if ($oPhoto->getTopicId()) {
|
||||
// проверяем права на топик
|
||||
if ($oTopic=$this->Topic_GetTopicById($oPhoto->getTopicId()) and $this->ACL_IsAllowEditTopic($oTopic,$this->oUserCurrent)) {
|
||||
$oPhoto->setDescription(htmlspecialchars(strip_tags(getRequest('text'))));
|
||||
$oPhoto->setDescription(htmlspecialchars(strip_tags(getRequestStr('text'))));
|
||||
$this->Topic_updateTopicPhoto($oPhoto);
|
||||
}
|
||||
} else {
|
||||
$oPhoto->setDescription(htmlspecialchars(strip_tags(getRequest('text'))));
|
||||
$oPhoto->setDescription(htmlspecialchars(strip_tags(getRequestStr('text'))));
|
||||
$this->Topic_updateTopicPhoto($oPhoto);
|
||||
}
|
||||
}
|
||||
|
@ -232,12 +232,12 @@ class ActionPhotoset extends Action {
|
|||
return false;
|
||||
}
|
||||
|
||||
$iTopicId = getRequest('topic_id');
|
||||
$iTopicId = getRequestStr('topic_id');
|
||||
$sTargetId = null;
|
||||
$iCountPhotos = 0;
|
||||
// Если от сервера не пришёл id топика, то пытаемся определить временный код для нового топика. Если и его нет. то это ошибка
|
||||
if (!$iTopicId) {
|
||||
$sTargetId = empty($_COOKIE['ls_photoset_target_tmp']) ? getRequest('ls_photoset_target_tmp') : $_COOKIE['ls_photoset_target_tmp'];
|
||||
$sTargetId = empty($_COOKIE['ls_photoset_target_tmp']) ? getRequestStr('ls_photoset_target_tmp') : $_COOKIE['ls_photoset_target_tmp'];
|
||||
if (!$sTargetId) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error'));
|
||||
return false;
|
||||
|
@ -430,10 +430,10 @@ class ActionPhotoset extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserId($this->oUserCurrent->getId());
|
||||
$oTopic->setType('photoset');
|
||||
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
|
||||
|
@ -488,7 +488,7 @@ class ActionPhotoset extends Action {
|
|||
|
||||
$sTargetTmp=$_COOKIE['ls_photoset_target_tmp'];
|
||||
$aPhotos = $this->Topic_getPhotosByTargetTmp($sTargetTmp);
|
||||
if (!($oPhotoMain=$this->Topic_getTopicPhotoById(getRequest('topic_main_photo')) and $oPhotoMain->getTargetTmp()==$sTargetTmp)) {
|
||||
if (!($oPhotoMain=$this->Topic_getTopicPhotoById(getRequestStr('topic_main_photo')) and $oPhotoMain->getTargetTmp()==$sTargetTmp)) {
|
||||
$oPhotoMain=$aPhotos[0];
|
||||
}
|
||||
$oTopic->setPhotosetMainPhotoId($oPhotoMain->getId());
|
||||
|
@ -586,10 +586,10 @@ class ActionPhotoset extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserIp(func_getIp());
|
||||
/**
|
||||
* Проверка корректности полей формы
|
||||
|
@ -640,7 +640,7 @@ class ActionPhotoset extends Action {
|
|||
$oTopic->setTextShort($this->Text_Parser($sTextShort));
|
||||
|
||||
$aPhotos = $oTopic->getPhotosetPhotos();
|
||||
if (!($oPhotoMain=$this->Topic_getTopicPhotoById(getRequest('topic_main_photo')) and $oPhotoMain->getTopicId()==$oTopic->getId())) {
|
||||
if (!($oPhotoMain=$this->Topic_getTopicPhotoById(getRequestStr('topic_main_photo')) and $oPhotoMain->getTopicId()==$oTopic->getId())) {
|
||||
$oPhotoMain=$aPhotos[0];
|
||||
}
|
||||
$oTopic->setPhotosetMainPhotoId($oPhotoMain->getId());
|
||||
|
|
|
@ -454,8 +454,8 @@ class ActionProfile extends Action {
|
|||
$oWall->_setValidateScenario('add');
|
||||
$oWall->setWallUserId($this->oUserProfile->getId());
|
||||
$oWall->setUserId($this->oUserCurrent->getId());
|
||||
$oWall->setText(getRequest('sText'));
|
||||
$oWall->setPid(getRequest('iPid'));
|
||||
$oWall->setText(getRequestStr('sText'));
|
||||
$oWall->setPid(getRequestStr('iPid'));
|
||||
|
||||
$this->Hook_Run('wall_add_validate_before', array('oWall'=>$oWall));
|
||||
if ($oWall->_Validate()) {
|
||||
|
@ -506,7 +506,7 @@ class ActionProfile extends Action {
|
|||
/**
|
||||
* Получаем запись
|
||||
*/
|
||||
if (!($oWall=$this->Wall_GetWallById(getRequest('iId')))) {
|
||||
if (!($oWall=$this->Wall_GetWallById(getRequestStr('iId')))) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
/**
|
||||
|
@ -565,7 +565,7 @@ class ActionProfile extends Action {
|
|||
if (!$this->CheckUserProfile()) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
if (!($oWall=$this->Wall_GetWallById(getRequest('iPid'))) or $oWall->getPid()) {
|
||||
if (!($oWall=$this->Wall_GetWallById(getRequestStr('iPid'))) or $oWall->getPid()) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
/**
|
||||
|
@ -611,9 +611,9 @@ class ActionProfile extends Action {
|
|||
* Создаем заметку и проводим валидацию
|
||||
*/
|
||||
$oNote=Engine::GetEntity('ModuleUser_EntityNote');
|
||||
$oNote->setTargetUserId(getRequest('iUserId'));
|
||||
$oNote->setTargetUserId(getRequestStr('iUserId'));
|
||||
$oNote->setUserId($this->oUserCurrent->getId());
|
||||
$oNote->setText((string)getRequest('text'));
|
||||
$oNote->setText(getRequestStr('text'));
|
||||
|
||||
if ($oNote->_Validate()) {
|
||||
/**
|
||||
|
@ -641,7 +641,7 @@ class ActionProfile extends Action {
|
|||
return parent::EventNotFound();
|
||||
}
|
||||
|
||||
if (!($oUserTarget=$this->User_GetUserById(getRequest('iUserId')))) {
|
||||
if (!($oUserTarget=$this->User_GetUserById(getRequestStr('iUserId')))) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
if (!($oNote=$this->User_GetUserNote($oUserTarget->getId(),$this->oUserCurrent->getId()))) {
|
||||
|
@ -696,7 +696,7 @@ class ActionProfile extends Action {
|
|||
/**
|
||||
* Из реквеста дешефруем ID польователя
|
||||
*/
|
||||
$sUserId=xxtea_decrypt(base64_decode(rawurldecode((string)getRequest('code'))), Config::Get('module.talk.encrypt'));
|
||||
$sUserId=xxtea_decrypt(base64_decode(rawurldecode(getRequestStr('code'))), Config::Get('module.talk.encrypt'));
|
||||
if (!$sUserId) {
|
||||
return $this->EventNotFound();
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ class ActionProfile extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUserId=getRequest('idUser',null,'post');
|
||||
$sUserId=getRequestStr('idUser',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -896,8 +896,8 @@ class ActionProfile extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUserId=getRequest('idUser');
|
||||
$sUserText=getRequest('userText','');
|
||||
$sUserId=getRequestStr('idUser');
|
||||
$sUserText=getRequestStr('userText','');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -1120,7 +1120,7 @@ class ActionProfile extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUserId=getRequest('idUser',null,'post');
|
||||
$sUserId=getRequestStr('idUser',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
|
|
@ -190,10 +190,10 @@ class ActionQuestion extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserId($this->oUserCurrent->getId());
|
||||
$oTopic->setType('question');
|
||||
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
|
||||
|
@ -246,7 +246,7 @@ class ActionQuestion extends Action {
|
|||
*/
|
||||
$oTopic->clearQuestionAnswer();
|
||||
foreach (getRequest('answer',array()) as $sAnswer) {
|
||||
$oTopic->addQuestionAnswer($sAnswer);
|
||||
$oTopic->addQuestionAnswer((string)$sAnswer);
|
||||
}
|
||||
/**
|
||||
* Публикуем или сохраняем
|
||||
|
@ -324,12 +324,12 @@ class ActionQuestion extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
if ($oTopic->getQuestionCountVote()==0) {
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
}
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserIp(func_getIp());
|
||||
/**
|
||||
* Проверка корректности полей формы
|
||||
|
@ -380,7 +380,7 @@ class ActionQuestion extends Action {
|
|||
if ($oTopic->getQuestionCountVote()==0) {
|
||||
$oTopic->clearQuestionAnswer();
|
||||
foreach (getRequest('answer',array()) as $sAnswer) {
|
||||
$oTopic->addQuestionAnswer($sAnswer);
|
||||
$oTopic->addQuestionAnswer((string)$sAnswer);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -476,6 +476,7 @@ class ActionQuestion extends Action {
|
|||
*/
|
||||
$aAnswers=getRequest('answer',array());
|
||||
foreach ($aAnswers as $key => $sAnswer) {
|
||||
$sAnswer=(string)$sAnswer;
|
||||
if (trim($sAnswer)=='') {
|
||||
unset($aAnswers[$key]);
|
||||
continue;
|
||||
|
|
|
@ -148,11 +148,11 @@ class ActionRegistration extends Action {
|
|||
/**
|
||||
* Заполняем поля (данные)
|
||||
*/
|
||||
$oUser->setLogin(getRequest('login'));
|
||||
$oUser->setMail(getRequest('mail'));
|
||||
$oUser->setPassword(getRequest('password'));
|
||||
$oUser->setPasswordConfirm(getRequest('password_confirm'));
|
||||
$oUser->setCaptcha(getRequest('captcha'));
|
||||
$oUser->setLogin(getRequestStr('login'));
|
||||
$oUser->setMail(getRequestStr('mail'));
|
||||
$oUser->setPassword(getRequestStr('password'));
|
||||
$oUser->setPasswordConfirm(getRequestStr('password_confirm'));
|
||||
$oUser->setCaptcha(getRequestStr('captcha'));
|
||||
$oUser->setDateRegister(date("Y-m-d H:i:s"));
|
||||
$oUser->setIpRegister(func_getIp());
|
||||
/**
|
||||
|
@ -198,10 +198,10 @@ class ActionRegistration extends Action {
|
|||
/**
|
||||
* Отправляем на мыло письмо о подтверждении регистрации
|
||||
*/
|
||||
$this->Notify_SendRegistrationActivate($oUser,getRequest('password'));
|
||||
$this->Notify_SendRegistrationActivate($oUser,getRequestStr('password'));
|
||||
$this->Viewer_AssignAjax('sUrlRedirect',Router::GetPath('registration').'confirm/');
|
||||
} else {
|
||||
$this->Notify_SendRegistration($oUser,getRequest('password'));
|
||||
$this->Notify_SendRegistration($oUser,getRequestStr('password'));
|
||||
$oUser=$this->User_GetUserById($oUser->getId());
|
||||
/**
|
||||
* Сразу авторизуем
|
||||
|
@ -212,8 +212,8 @@ class ActionRegistration extends Action {
|
|||
* Определяем URL для редиректа после авторизации
|
||||
*/
|
||||
$sUrl=Config::Get('module.user.redirect_after_registration');
|
||||
if (getRequest('return-path')) {
|
||||
$sUrl=getRequest('return-path');
|
||||
if (getRequestStr('return-path')) {
|
||||
$sUrl=getRequestStr('return-path');
|
||||
}
|
||||
$this->Viewer_AssignAjax('sUrlRedirect',$sUrl ? $sUrl : Config::Get('path.root.web'));
|
||||
$this->Message_AddNoticeSingle($this->Lang_Get('registration_ok'));
|
||||
|
@ -304,7 +304,7 @@ class ActionRegistration extends Action {
|
|||
if ($this->CheckInviteRegister()) {
|
||||
$sInviteId=$this->GetInviteRegister();
|
||||
} else {
|
||||
$sInviteId=getRequest('invite_code');
|
||||
$sInviteId=getRequestStr('invite_code');
|
||||
}
|
||||
$oInvate=$this->User_GetInviteByCode($sInviteId);
|
||||
if ($oInvate) {
|
||||
|
|
|
@ -169,7 +169,7 @@ class ActionSearch extends Action {
|
|||
* @return array
|
||||
*/
|
||||
private function PrepareRequest(){
|
||||
$aReq['q'] = getRequest('q');
|
||||
$aReq['q'] = getRequestStr('q');
|
||||
if (!func_check($aReq['q'],'text', 2, 255)) {
|
||||
/**
|
||||
* Если запрос слишком короткий перенаправляем на начальную страницу поиска
|
||||
|
|
|
@ -360,8 +360,8 @@ class ActionSettings extends Action {
|
|||
if (isPost('submit_settings_tuning')) {
|
||||
$this->Security_ValidateSendForm();
|
||||
|
||||
if (in_array(getRequest('settings_general_timezone'),$aTimezoneList)) {
|
||||
$this->oUserCurrent->setSettingsTimezone(getRequest('settings_general_timezone'));
|
||||
if (in_array(getRequestStr('settings_general_timezone'),$aTimezoneList)) {
|
||||
$this->oUserCurrent->setSettingsTimezone(getRequestStr('settings_general_timezone'));
|
||||
}
|
||||
|
||||
$this->oUserCurrent->setSettingsNoticeNewTopic( getRequest('settings_notice_new_topic') ? 1 : 0 );
|
||||
|
@ -420,7 +420,7 @@ class ActionSettings extends Action {
|
|||
/**
|
||||
* Емайл корректен?
|
||||
*/
|
||||
if (!func_check(getRequest('invite_mail'),'mail')) {
|
||||
if (!func_check(getRequestStr('invite_mail'),'mail')) {
|
||||
$this->Message_AddError($this->Lang_Get('settings_invite_mail_error'),$this->Lang_Get('error'));
|
||||
$bError=true;
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ class ActionSettings extends Action {
|
|||
*/
|
||||
if (!$bError) {
|
||||
$oInvite=$this->User_GenerateInvite($this->oUserCurrent);
|
||||
$this->Notify_SendInvite($this->oUserCurrent,getRequest('invite_mail'),$oInvite);
|
||||
$this->Notify_SendInvite($this->oUserCurrent,getRequestStr('invite_mail'),$oInvite);
|
||||
$this->Message_AddNoticeSingle($this->Lang_Get('settings_invite_submit_ok'));
|
||||
$this->Hook_Run('settings_invate_send_after', array('oUser'=>$this->oUserCurrent));
|
||||
}
|
||||
|
@ -461,8 +461,8 @@ class ActionSettings extends Action {
|
|||
/**
|
||||
* Проверка мыла
|
||||
*/
|
||||
if (func_check(getRequest('mail'),'mail')) {
|
||||
if ($oUserMail=$this->User_GetUserByMail(getRequest('mail')) and $oUserMail->getId()!=$this->oUserCurrent->getId()) {
|
||||
if (func_check(getRequestStr('mail'),'mail')) {
|
||||
if ($oUserMail=$this->User_GetUserByMail(getRequestStr('mail')) and $oUserMail->getId()!=$this->oUserCurrent->getId()) {
|
||||
$this->Message_AddError($this->Lang_Get('settings_profile_mail_error_used'),$this->Lang_Get('error'));
|
||||
$bError=true;
|
||||
}
|
||||
|
@ -473,11 +473,11 @@ class ActionSettings extends Action {
|
|||
/**
|
||||
* Проверка на смену пароля
|
||||
*/
|
||||
if (getRequest('password','')!='') {
|
||||
if (func_check(getRequest('password'),'password',5)) {
|
||||
if (getRequest('password')==getRequest('password_confirm')) {
|
||||
if (func_encrypt(getRequest('password_now'))==$this->oUserCurrent->getPassword()) {
|
||||
$this->oUserCurrent->setPassword(func_encrypt(getRequest('password')));
|
||||
if (getRequestStr('password','')!='') {
|
||||
if (func_check(getRequestStr('password'),'password',5)) {
|
||||
if (getRequestStr('password')==getRequestStr('password_confirm')) {
|
||||
if (func_encrypt(getRequestStr('password_now'))==$this->oUserCurrent->getPassword()) {
|
||||
$this->oUserCurrent->setPassword(func_encrypt(getRequestStr('password')));
|
||||
} else {
|
||||
$bError=true;
|
||||
$this->Message_AddError($this->Lang_Get('settings_profile_password_current_error'),$this->Lang_Get('error'));
|
||||
|
@ -508,8 +508,8 @@ class ActionSettings extends Action {
|
|||
/**
|
||||
* Подтверждение смены емайла
|
||||
*/
|
||||
if (getRequest('mail') and getRequest('mail')!=$this->oUserCurrent->getMail()) {
|
||||
if ($oChangemail=$this->User_MakeUserChangemail($this->oUserCurrent,getRequest('mail'))) {
|
||||
if (getRequestStr('mail') and getRequestStr('mail')!=$this->oUserCurrent->getMail()) {
|
||||
if ($oChangemail=$this->User_MakeUserChangemail($this->oUserCurrent,getRequestStr('mail'))) {
|
||||
if ($oChangemail->getMailFrom()) {
|
||||
$this->Message_AddNotice($this->Lang_Get('settings_profile_mail_change_from_notice'));
|
||||
} else {
|
||||
|
@ -556,43 +556,43 @@ class ActionSettings extends Action {
|
|||
* Определяем гео-объект
|
||||
*/
|
||||
if (getRequest('geo_city')) {
|
||||
$oGeoObject=$this->Geo_GetGeoObject('city',getRequest('geo_city'));
|
||||
$oGeoObject=$this->Geo_GetGeoObject('city',getRequestStr('geo_city'));
|
||||
} elseif (getRequest('geo_region')) {
|
||||
$oGeoObject=$this->Geo_GetGeoObject('region',getRequest('geo_region'));
|
||||
$oGeoObject=$this->Geo_GetGeoObject('region',getRequestStr('geo_region'));
|
||||
} elseif (getRequest('geo_country')) {
|
||||
$oGeoObject=$this->Geo_GetGeoObject('country',getRequest('geo_country'));
|
||||
$oGeoObject=$this->Geo_GetGeoObject('country',getRequestStr('geo_country'));
|
||||
} else {
|
||||
$oGeoObject=null;
|
||||
}
|
||||
/**
|
||||
* Проверяем имя
|
||||
*/
|
||||
if (func_check(getRequest('profile_name'),'text',2,Config::Get('module.user.name_max'))) {
|
||||
$this->oUserCurrent->setProfileName(getRequest('profile_name'));
|
||||
if (func_check(getRequestStr('profile_name'),'text',2,Config::Get('module.user.name_max'))) {
|
||||
$this->oUserCurrent->setProfileName(getRequestStr('profile_name'));
|
||||
} else {
|
||||
$this->oUserCurrent->setProfileName(null);
|
||||
}
|
||||
/**
|
||||
* Проверяем пол
|
||||
*/
|
||||
if (in_array(getRequest('profile_sex'),array('man','woman','other'))) {
|
||||
$this->oUserCurrent->setProfileSex(getRequest('profile_sex'));
|
||||
if (in_array(getRequestStr('profile_sex'),array('man','woman','other'))) {
|
||||
$this->oUserCurrent->setProfileSex(getRequestStr('profile_sex'));
|
||||
} else {
|
||||
$this->oUserCurrent->setProfileSex('other');
|
||||
}
|
||||
/**
|
||||
* Проверяем дату рождения
|
||||
*/
|
||||
if (func_check(getRequest('profile_birthday_day'),'id',1,2) and func_check(getRequest('profile_birthday_month'),'id',1,2) and func_check(getRequest('profile_birthday_year'),'id',4,4)) {
|
||||
$this->oUserCurrent->setProfileBirthday(date("Y-m-d H:i:s",mktime(0,0,0,getRequest('profile_birthday_month'),getRequest('profile_birthday_day'),getRequest('profile_birthday_year'))));
|
||||
if (func_check(getRequestStr('profile_birthday_day'),'id',1,2) and func_check(getRequestStr('profile_birthday_month'),'id',1,2) and func_check(getRequestStr('profile_birthday_year'),'id',4,4)) {
|
||||
$this->oUserCurrent->setProfileBirthday(date("Y-m-d H:i:s",mktime(0,0,0,getRequestStr('profile_birthday_month'),getRequestStr('profile_birthday_day'),getRequestStr('profile_birthday_year'))));
|
||||
} else {
|
||||
$this->oUserCurrent->setProfileBirthday(null);
|
||||
}
|
||||
/**
|
||||
* Проверяем информацию о себе
|
||||
*/
|
||||
if (func_check(getRequest('profile_about'),'text',1,3000)) {
|
||||
$this->oUserCurrent->setProfileAbout($this->Text_Parser(getRequest('profile_about')));
|
||||
if (func_check(getRequestStr('profile_about'),'text',1,3000)) {
|
||||
$this->oUserCurrent->setProfileAbout($this->Text_Parser(getRequestStr('profile_about')));
|
||||
} else {
|
||||
$this->oUserCurrent->setProfileAbout(null);
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ class ActionSettings extends Action {
|
|||
$aData = array();
|
||||
foreach ($aFields as $iId => $aField) {
|
||||
if (isset($_REQUEST['profile_user_field_'.$iId])) {
|
||||
$aData[$iId] = (string)getRequest('profile_user_field_'.$iId);
|
||||
$aData[$iId] = getRequestStr('profile_user_field_'.$iId);
|
||||
}
|
||||
}
|
||||
$this->User_setUserFieldsValues($this->oUserCurrent->getId(), $aData);
|
||||
|
@ -661,6 +661,7 @@ class ActionSettings extends Action {
|
|||
$aFieldsContactValue=getRequest('profile_user_field_value');
|
||||
if (is_array($aFieldsContactType)) {
|
||||
foreach($aFieldsContactType as $k=>$v) {
|
||||
$v=(string)$v;
|
||||
if (isset($aFields[$v]) and isset($aFieldsContactValue[$k]) and is_string($aFieldsContactValue[$k])) {
|
||||
$this->User_setUserFieldsValues($this->oUserCurrent->getId(), array($v=>$aFieldsContactValue[$k]), Config::Get('module.user.userfield_max_identical'));
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ class ActionStream extends Action {
|
|||
/**
|
||||
* Активируем/деактивируем тип
|
||||
*/
|
||||
$this->Stream_switchUserEventType($this->oUserCurrent->getId(), getRequest('type'));
|
||||
$this->Stream_switchUserEventType($this->oUserCurrent->getId(), getRequestStr('type'));
|
||||
$this->Message_AddNotice($this->Lang_Get('stream_subscribes_updated'), $this->Lang_Get('attention'));
|
||||
}
|
||||
/**
|
||||
|
@ -157,7 +157,7 @@ class ActionStream extends Action {
|
|||
/**
|
||||
* Необходимо передать последний просмотренный ID событий
|
||||
*/
|
||||
$iFromId = getRequest('last_id');
|
||||
$iFromId = getRequestStr('last_id');
|
||||
if (!$iFromId) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -169,7 +169,7 @@ class ActionStream extends Action {
|
|||
|
||||
$oViewer=$this->Viewer_GetLocalViewer();
|
||||
$oViewer->Assign('aStreamEvents', $aEvents);
|
||||
$oViewer->Assign('sDateLast', getRequest('date_last'));
|
||||
$oViewer->Assign('sDateLast', getRequestStr('date_last'));
|
||||
if (count($aEvents)) {
|
||||
$oEvenLast=end($aEvents);
|
||||
$this->Viewer_AssignAjax('iStreamLastId', $oEvenLast->getId());
|
||||
|
@ -198,7 +198,7 @@ class ActionStream extends Action {
|
|||
/**
|
||||
* Необходимо передать последний просмотренный ID событий
|
||||
*/
|
||||
$iFromId = getRequest('last_id');
|
||||
$iFromId = getRequestStr('last_id');
|
||||
if (!$iFromId) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -210,7 +210,7 @@ class ActionStream extends Action {
|
|||
|
||||
$oViewer=$this->Viewer_GetLocalViewer();
|
||||
$oViewer->Assign('aStreamEvents', $aEvents);
|
||||
$oViewer->Assign('sDateLast', getRequest('date_last'));
|
||||
$oViewer->Assign('sDateLast', getRequestStr('date_last'));
|
||||
if (count($aEvents)) {
|
||||
$oEvenLast=end($aEvents);
|
||||
$this->Viewer_AssignAjax('iStreamLastId', $oEvenLast->getId());
|
||||
|
@ -239,12 +239,12 @@ class ActionStream extends Action {
|
|||
/**
|
||||
* Необходимо передать последний просмотренный ID событий
|
||||
*/
|
||||
$iFromId = getRequest('last_id');
|
||||
$iFromId = getRequestStr('last_id');
|
||||
if (!$iFromId) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
if (!($oUser=$this->User_GetUserById(getRequest('user_id')))) {
|
||||
if (!($oUser=$this->User_GetUserById(getRequestStr('user_id')))) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ class ActionStream extends Action {
|
|||
|
||||
$oViewer=$this->Viewer_GetLocalViewer();
|
||||
$oViewer->Assign('aStreamEvents', $aEvents);
|
||||
$oViewer->Assign('sDateLast', getRequest('date_last'));
|
||||
$oViewer->Assign('sDateLast', getRequestStr('date_last'));
|
||||
if (count($aEvents)) {
|
||||
$oEvenLast=end($aEvents);
|
||||
$this->Viewer_AssignAjax('iStreamLastId', $oEvenLast->getId());
|
||||
|
@ -284,17 +284,17 @@ class ActionStream extends Action {
|
|||
/**
|
||||
* Проверяем существование пользователя
|
||||
*/
|
||||
if (!$this->User_getUserById(getRequest('id'))) {
|
||||
if (!$this->User_getUserById(getRequestStr('id'))) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
}
|
||||
if ($this->oUserCurrent->getId() == getRequest('id')) {
|
||||
if ($this->oUserCurrent->getId() == getRequestStr('id')) {
|
||||
$this->Message_AddError($this->Lang_Get('stream_error_subscribe_to_yourself'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Подписываем на пользователя
|
||||
*/
|
||||
$this->Stream_subscribeUser($this->oUserCurrent->getId(), getRequest('id'));
|
||||
$this->Stream_subscribeUser($this->oUserCurrent->getId(), getRequestStr('id'));
|
||||
$this->Message_AddNotice($this->Lang_Get('stream_subscribes_updated'), $this->Lang_Get('attention'));
|
||||
}
|
||||
/**
|
||||
|
@ -319,9 +319,9 @@ class ActionStream extends Action {
|
|||
/**
|
||||
* Проверяем существование пользователя
|
||||
*/
|
||||
$oUser = $this->User_getUserByLogin(getRequest('login'));
|
||||
$oUser = $this->User_getUserByLogin(getRequestStr('login'));
|
||||
if (!$oUser) {
|
||||
$this->Message_AddError($this->Lang_Get('user_not_found',array('login'=>htmlspecialchars(getRequest('login')))),$this->Lang_Get('error'));
|
||||
$this->Message_AddError($this->Lang_Get('user_not_found',array('login'=>htmlspecialchars(getRequestStr('login')))),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
if ($this->oUserCurrent->getId() == $oUser->getId()) {
|
||||
|
@ -356,13 +356,13 @@ class ActionStream extends Action {
|
|||
/**
|
||||
* Пользователь с таким ID существует?
|
||||
*/
|
||||
if (!$this->User_getUserById(getRequest('id'))) {
|
||||
if (!$this->User_getUserById(getRequestStr('id'))) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
}
|
||||
/**
|
||||
* Отписываем
|
||||
*/
|
||||
$this->Stream_unsubscribeUser($this->oUserCurrent->getId(), getRequest('id'));
|
||||
$this->Stream_unsubscribeUser($this->oUserCurrent->getId(), getRequestStr('id'));
|
||||
$this->Message_AddNotice($this->Lang_Get('stream_subscribes_updated'), $this->Lang_Get('attention'));
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -88,7 +88,7 @@ class ActionSubscribe extends Action {
|
|||
/**
|
||||
* Получаем емайл подписки и проверяем его на валидность
|
||||
*/
|
||||
$sMail=getRequest('mail');
|
||||
$sMail=getRequestStr('mail');
|
||||
if ($this->oUserCurrent) {
|
||||
$sMail=$this->oUserCurrent->getMail();
|
||||
}
|
||||
|
@ -99,12 +99,12 @@ class ActionSubscribe extends Action {
|
|||
/**
|
||||
* Получаем тип объекта подписки
|
||||
*/
|
||||
$sTargetType=getRequest('target_type');
|
||||
$sTargetType=getRequestStr('target_type');
|
||||
if (!$this->Subscribe_IsAllowTargetType($sTargetType)) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return ;
|
||||
}
|
||||
$sTargetId=getRequest('target_id') ? getRequest('target_id') : null;
|
||||
$sTargetId=getRequestStr('target_id') ? getRequestStr('target_id') : null;
|
||||
$iValue=getRequest('value') ? 1 : 0;
|
||||
|
||||
$oSubscribe=null;
|
||||
|
|
|
@ -216,7 +216,7 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Дата старта поиска
|
||||
*/
|
||||
if($start=getRequest('start')) {
|
||||
if($start=getRequestStr('start')) {
|
||||
if(func_check($start,'text',6,10) && substr_count($start,'.')==2) {
|
||||
list($d,$m,$y)=explode('.',$start);
|
||||
if(@checkdate($m,$d,$y)) {
|
||||
|
@ -239,7 +239,7 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Дата окончания поиска
|
||||
*/
|
||||
if($end=getRequest('end')) {
|
||||
if($end=getRequestStr('end')) {
|
||||
if(func_check($end,'text',6,10) && substr_count($end,'.')==2) {
|
||||
list($d,$m,$y)=explode('.',$end);
|
||||
if(@checkdate($m,$d,$y)) {
|
||||
|
@ -377,7 +377,7 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Отправляем письмо
|
||||
*/
|
||||
if ($oTalk=$this->Talk_SendTalk($this->Text_Parser(strip_tags(getRequest('talk_title'))),$this->Text_Parser(getRequest('talk_text')),$this->oUserCurrent,$this->aUsersId)) {
|
||||
if ($oTalk=$this->Talk_SendTalk($this->Text_Parser(strip_tags(getRequestStr('talk_title'))),$this->Text_Parser(getRequestStr('talk_text')),$this->oUserCurrent,$this->aUsersId)) {
|
||||
Router::Location(Router::GetPath('talk').'read/'.$oTalk->getId().'/');
|
||||
} else {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'));
|
||||
|
@ -463,14 +463,14 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Проверяем есть ли заголовок
|
||||
*/
|
||||
if (!func_check(getRequest('talk_title'),'text',2,200)) {
|
||||
if (!func_check(getRequestStr('talk_title'),'text',2,200)) {
|
||||
$this->Message_AddError($this->Lang_Get('talk_create_title_error'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
}
|
||||
/**
|
||||
* Проверяем есть ли содержание топика
|
||||
*/
|
||||
if (!func_check(getRequest('talk_text'),'text',2,3000)) {
|
||||
if (!func_check(getRequestStr('talk_text'),'text',2,3000)) {
|
||||
$this->Message_AddError($this->Lang_Get('talk_create_text_error'),$this->Lang_Get('error'));
|
||||
$bOk=false;
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ class ActionTalk extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$idCommentLast=getRequest('idCommentLast');
|
||||
$idCommentLast=getRequestStr('idCommentLast');
|
||||
/**
|
||||
* Проверям авторизован ли пользователь
|
||||
*/
|
||||
|
@ -548,7 +548,7 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Проверяем разговор
|
||||
*/
|
||||
if (!($oTalk=$this->Talk_GetTalkById(getRequest('idTarget')))) {
|
||||
if (!($oTalk=$this->Talk_GetTalkById(getRequestStr('idTarget')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Проверяем разговор
|
||||
*/
|
||||
if (!($oTalk=$this->Talk_GetTalkById(getRequest('cmt_target_id')))) {
|
||||
if (!($oTalk=$this->Talk_GetTalkById(getRequestStr('cmt_target_id')))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -629,7 +629,7 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Проверяем текст комментария
|
||||
*/
|
||||
$sText=$this->Text_Parser(getRequest('comment_text'));
|
||||
$sText=$this->Text_Parser(getRequestStr('comment_text'));
|
||||
if (!func_check($sText,'text',2,3000)) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('talk_comment_add_text_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -724,7 +724,7 @@ class ActionTalk extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUsers=(string)getRequest('users',null,'post');
|
||||
$sUsers=getRequestStr('users',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -817,7 +817,7 @@ class ActionTalk extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$idTarget=(string)getRequest('idTarget',null,'post');
|
||||
$idTarget=getRequestStr('idTarget',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -882,8 +882,8 @@ class ActionTalk extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$idTarget=(string)getRequest('idTarget',null,'post');
|
||||
$idTalk=(string)getRequest('idTalk',null,'post');
|
||||
$idTarget=getRequestStr('idTarget',null,'post');
|
||||
$idTalk=getRequestStr('idTalk',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
@ -960,8 +960,8 @@ class ActionTalk extends Action {
|
|||
* Устанавливаем формат Ajax ответа
|
||||
*/
|
||||
$this->Viewer_SetResponseAjax('json');
|
||||
$sUsers=(string)getRequest('users',null,'post');
|
||||
$idTalk=(string)getRequest('idTalk',null,'post');
|
||||
$sUsers=getRequestStr('users',null,'post');
|
||||
$idTalk=getRequestStr('idTalk',null,'post');
|
||||
/**
|
||||
* Если пользователь не авторизирован, возвращаем ошибку
|
||||
*/
|
||||
|
|
|
@ -239,10 +239,10 @@ class ActionTopic extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserId($this->oUserCurrent->getId());
|
||||
$oTopic->setType('topic');
|
||||
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
|
||||
|
@ -373,10 +373,10 @@ class ActionTopic extends Action {
|
|||
/**
|
||||
* Заполняем поля для валидации
|
||||
*/
|
||||
$oTopic->setBlogId(getRequest('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequest('topic_title')));
|
||||
$oTopic->setTextSource(getRequest('topic_text'));
|
||||
$oTopic->setTags(getRequest('topic_tags'));
|
||||
$oTopic->setBlogId(getRequestStr('blog_id'));
|
||||
$oTopic->setTitle(strip_tags(getRequestStr('topic_title')));
|
||||
$oTopic->setTextSource(getRequestStr('topic_text'));
|
||||
$oTopic->setTags(getRequestStr('topic_tags'));
|
||||
$oTopic->setUserIp(func_getIp());
|
||||
/**
|
||||
* Проверка корректности полей формы
|
||||
|
|
|
@ -92,7 +92,7 @@ class ActionUserfeed extends Action {
|
|||
/**
|
||||
* Проверяем последний просмотренный ID топика
|
||||
*/
|
||||
$iFromId = getRequest('last_id');
|
||||
$iFromId = getRequestStr('last_id');
|
||||
if (!$iFromId) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -132,7 +132,7 @@ class ActionUserfeed extends Action {
|
|||
if (!getRequest('id')) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
}
|
||||
$sType = (string)getRequest('type');
|
||||
$sType = getRequestStr('type');
|
||||
$iType = null;
|
||||
/**
|
||||
* Определяем тип подписки
|
||||
|
@ -143,7 +143,7 @@ class ActionUserfeed extends Action {
|
|||
/**
|
||||
* Проверяем существование блога
|
||||
*/
|
||||
if (!$this->Blog_GetBlogById(getRequest('id'))) {
|
||||
if (!$this->Blog_GetBlogById(getRequestStr('id'))) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -153,11 +153,11 @@ class ActionUserfeed extends Action {
|
|||
/**
|
||||
* Проверяем существование пользователя
|
||||
*/
|
||||
if (!$this->User_GetUserById(getRequest('id'))) {
|
||||
if (!$this->User_GetUserById(getRequestStr('id'))) {
|
||||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
if ($this->oUserCurrent->getId() == getRequest('id')) {
|
||||
if ($this->oUserCurrent->getId() == getRequestStr('id')) {
|
||||
$this->Message_AddError($this->Lang_Get('userfeed_error_subscribe_to_yourself'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ class ActionUserfeed extends Action {
|
|||
/**
|
||||
* Подписываем
|
||||
*/
|
||||
$this->Userfeed_subscribeUser($this->oUserCurrent->getId(), $iType, getRequest('id'));
|
||||
$this->Userfeed_subscribeUser($this->oUserCurrent->getId(), $iType, getRequestStr('id'));
|
||||
$this->Message_AddNotice($this->Lang_Get('userfeed_subscribes_updated'), $this->Lang_Get('attention'));
|
||||
}
|
||||
/**
|
||||
|
@ -191,9 +191,9 @@ class ActionUserfeed extends Action {
|
|||
/**
|
||||
* Проверяем существование прользователя
|
||||
*/
|
||||
$oUser = $this->User_getUserByLogin(getRequest('login'));
|
||||
$oUser = $this->User_getUserByLogin(getRequestStr('login'));
|
||||
if (!$oUser) {
|
||||
$this->Message_AddError($this->Lang_Get('user_not_found',array('login'=>htmlspecialchars(getRequest('login')))),$this->Lang_Get('error'));
|
||||
$this->Message_AddError($this->Lang_Get('user_not_found',array('login'=>htmlspecialchars(getRequestStr('login')))),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
/**
|
||||
|
@ -231,7 +231,7 @@ class ActionUserfeed extends Action {
|
|||
$this->Message_AddError($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
$sType = (string)getRequest('type');
|
||||
$sType = getRequestStr('type');
|
||||
$iType = null;
|
||||
/**
|
||||
* Определяем от чего отписываемся
|
||||
|
@ -250,7 +250,7 @@ class ActionUserfeed extends Action {
|
|||
/**
|
||||
* Отписываем пользователя
|
||||
*/
|
||||
$this->Userfeed_unsubscribeUser($this->oUserCurrent->getId(), $iType, getRequest('id'));
|
||||
$this->Userfeed_unsubscribeUser($this->oUserCurrent->getId(), $iType, getRequestStr('id'));
|
||||
$this->Message_AddNotice($this->Lang_Get('userfeed_subscribes_updated'), $this->Lang_Get('attention'));
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -418,7 +418,7 @@ class ModuleTalk extends Module {
|
|||
$aTalkId=array($aTalkId);
|
||||
}
|
||||
foreach ($aTalkId as $sTalkId) {
|
||||
if ($oTalk=$this->Talk_GetTalkById($sTalkId)) {
|
||||
if ($oTalk=$this->Talk_GetTalkById((string)$sTalkId)) {
|
||||
if ($oTalkUser=$this->Talk_GetTalkUser($oTalk->getId(),$iUserId)) {
|
||||
$oTalkUser->setDateLast(date("Y-m-d H:i:s"));
|
||||
if ($oTalk->getCommentIdLast()) {
|
||||
|
@ -447,7 +447,7 @@ class ModuleTalk extends Module {
|
|||
$this->DeleteFavouriteTalk(
|
||||
Engine::GetEntity('Favourite',
|
||||
array(
|
||||
'target_id' => $sTalkId,
|
||||
'target_id' => (string)$sTalkId,
|
||||
'target_type' => 'talk',
|
||||
'user_id' => $sUserId
|
||||
)
|
||||
|
@ -456,6 +456,7 @@ class ModuleTalk extends Module {
|
|||
}
|
||||
// Нужно почистить зависимые кеши
|
||||
foreach ($aTalkId as $sTalkId) {
|
||||
$sTalkId=(string)$sTalkId;
|
||||
$this->Cache_Clean(
|
||||
Zend_Cache::CLEANING_MODE_MATCHING_TAG,
|
||||
array("update_talk_user_{$sTalkId}")
|
||||
|
@ -466,6 +467,7 @@ class ModuleTalk extends Module {
|
|||
|
||||
// Удаляем пустые беседы, если в них нет пользователей
|
||||
foreach ($aTalkId as $sTalkId) {
|
||||
$sTalkId=(string)$sTalkId;
|
||||
if (!count($this->GetUsersTalk($sTalkId, array(self::TALK_USER_ACTIVE)))) {
|
||||
$this->DeleteTalk($sTalkId);
|
||||
}
|
||||
|
|
2
engine/console/.htaccess
Normal file
2
engine/console/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
Order Deny,Allow
|
||||
Deny from all
|
2
engine/include/.htaccess
Normal file
2
engine/include/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
Order Deny,Allow
|
||||
Deny from all
|
|
@ -102,6 +102,19 @@ function getRequest($sName,$default=null,$sType=null) {
|
|||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* функция доступа к GET POST параметрам, которая значение принудительно приводит к строке
|
||||
*
|
||||
* @param string $sName
|
||||
* @param mixed $default
|
||||
* @param string $sType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getRequestStr($sName,$default=null,$sType=null) {
|
||||
return (string)getRequest($sName,$default,$sType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Определяет был ли передан указанный параметр методом POST
|
||||
*
|
||||
|
|
2
engine/lib/internal/ConfigSimple/.htaccess
Normal file
2
engine/lib/internal/ConfigSimple/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
Order Deny,Allow
|
||||
Deny from all
|
2
engine/lib/internal/ProfilerSimple/.htaccess
Normal file
2
engine/lib/internal/ProfilerSimple/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
Order Deny,Allow
|
||||
Deny from all
|
2
engine/modules/.htaccess
Normal file
2
engine/modules/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
Order Deny,Allow
|
||||
Deny from all
|
|
@ -354,6 +354,7 @@ class ModulePlugin extends Module {
|
|||
|
||||
$aActivePlugins=$this->GetActivePlugins();
|
||||
foreach ($aPlugins as $sPluginCode) {
|
||||
if (!is_string($sPluginCode)) continue;
|
||||
/**
|
||||
* Если плагин активен, деактивируем его
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue