mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 12:32:14 +09:00
Remove support for $is_admin in getDocument(), getDocuments(), getComment()
단순히 문서나 댓글을 불러오는 동작에서는 $is_admin 변수를 무시하도록 합니다. 서드파티 자료에서 사용할 경우 해당 문서나 댓글에 관리자 권한이 부여되어 버려서 보안취약점이 발생할 수 있기 때문입니다. 실제로 많은 서드파티 자료들이 이 변수가 왜 필요한지, 어떤 기능을 하는지 이해하지 못하는 상태로 무작정 복붙하여 사용하고 있습니다. 이러한 서드파티 자료에서 이 패치로 인해 오작동이 발생할 경우에는 그 때 가서 적절한 조치를 취하도록 하겠습니다. getDocumentListByMemberSrl(), getCommentListByMemberSrl(), getCommentList() 등 일부 메소드에서는 이미 $is_admin 변수를 무시하도록 되어 있습니다.
This commit is contained in:
parent
5c99a23e68
commit
61f6456b6c
4 changed files with 11 additions and 2 deletions
|
|
@ -157,10 +157,12 @@ class commentModel extends comment
|
||||||
public static function getComment($comment_srl = 0, $is_admin = FALSE, $columnList = array())
|
public static function getComment($comment_srl = 0, $is_admin = FALSE, $columnList = array())
|
||||||
{
|
{
|
||||||
$oComment = new commentItem($comment_srl, $columnList);
|
$oComment = new commentItem($comment_srl, $columnList);
|
||||||
|
/*
|
||||||
if($is_admin)
|
if($is_admin)
|
||||||
{
|
{
|
||||||
$oComment->setGrant();
|
$oComment->setGrant();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return $oComment;
|
return $oComment;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3120,7 +3120,7 @@ Content;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$documentList = array();
|
$documentList = array();
|
||||||
$this->setMessage(lang(no_documents));
|
$this->setMessage(lang('no_documents'));
|
||||||
}
|
}
|
||||||
$oSecurity = new Security($documentList);
|
$oSecurity = new Security($documentList);
|
||||||
$oSecurity->encodeHTML('..variables.');
|
$oSecurity->encodeHTML('..variables.');
|
||||||
|
|
|
||||||
|
|
@ -1040,7 +1040,10 @@ class documentItem extends BaseObject
|
||||||
if(!$this->allowTrackback() || !$this->get('trackback_count')) return;
|
if(!$this->allowTrackback() || !$this->get('trackback_count')) return;
|
||||||
|
|
||||||
$oTrackbackModel = getModel('trackback');
|
$oTrackbackModel = getModel('trackback');
|
||||||
return $oTrackbackModel->getTrackbackList($this->document_srl, $is_admin);
|
if ($oTrackbackModel)
|
||||||
|
{
|
||||||
|
return $oTrackbackModel->getTrackbackList($this->document_srl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function thumbnailExists($width = 80, $height = 0, $type = '')
|
function thumbnailExists($width = 80, $height = 0, $type = '')
|
||||||
|
|
|
||||||
|
|
@ -169,10 +169,12 @@ class documentModel extends document
|
||||||
return $oDocument;
|
return $oDocument;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if($is_admin)
|
if($is_admin)
|
||||||
{
|
{
|
||||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant();
|
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||||
}
|
}
|
||||||
|
|
@ -210,10 +212,12 @@ class documentModel extends document
|
||||||
$oDocument = new documentItem();
|
$oDocument = new documentItem();
|
||||||
$oDocument->setAttribute($attribute, false);
|
$oDocument->setAttribute($attribute, false);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if($is_admin)
|
if($is_admin)
|
||||||
{
|
{
|
||||||
$GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl]->setGrant();
|
$GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl]->setGrant();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$documents[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
$documents[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue