mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-10 04:03:01 +09:00
#1860 embed filter에 사용되는 도메인 목록에 대한 escape 처리
- escape 되지 않은 dot(.)으로 인해 유사 도메인에 대한 공격에 노출될 수 있는 문제
This commit is contained in:
parent
6cb5733cad
commit
054e92e0b4
1 changed files with 5 additions and 17 deletions
|
|
@ -142,28 +142,16 @@ class Purifier
|
|||
|
||||
private function _getWhiteDomainRegx()
|
||||
{
|
||||
require_once(_XE_PATH_ . 'classes/security/EmbedFilter.class.php');
|
||||
$oEmbedFilter = EmbedFilter::getInstance();
|
||||
$whiteIframeUrlList = $oEmbedFilter->getWhiteIframeUrlList();
|
||||
|
||||
$whiteDomainRegex = '%^(';
|
||||
$whiteDomainCount = count($whiteIframeUrlList);
|
||||
|
||||
$i=1;
|
||||
if(is_array($whiteIframeUrlList))
|
||||
$whiteDomain = array();
|
||||
foreach($whiteIframeUrlList as $value)
|
||||
{
|
||||
foreach($whiteIframeUrlList as $value)
|
||||
{
|
||||
$whiteDomainRegex .= $value;
|
||||
|
||||
if($i < $whiteDomainCount)
|
||||
{
|
||||
$whiteDomainRegex .= '|';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$whiteDomain[] = preg_quote($value, '%');
|
||||
}
|
||||
$whiteDomainRegex .= ')%';
|
||||
|
||||
$whiteDomainRegex = '%^(' . implode('|', $whiteDomain) . ')%';
|
||||
|
||||
return $whiteDomainRegex;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue