"XE:일반 회원 특수 태그 허용"의 두 판 사이의 차이

Hunter Hall
이동: 둘러보기, 검색
(2016-02-22 Hunter Hall 적용)
(태그: visualeditor)
 
(ruby 엘리먼트는 블록 엘리먼트보다는 인라인 엘리먼트로 처리하는 편이 나음.)
20번째 줄: 20번째 줄:
 
$this->_def = $this->_config->getHTMLDefinition(TRUE);
 
$this->_def = $this->_config->getHTMLDefinition(TRUE);
 
 
$this->_def->addElement('ruby', 'Block', 'Flow', 'Common', array());
+
$this->_def->addElement('ruby', 'Inline', 'Flow', 'Common', array());
 
         $this->_def->addElement('rp', 'Inline', 'Inline', 'Common', array());
 
         $this->_def->addElement('rp', 'Inline', 'Inline', 'Common', array());
 
         $this->_def->addElement('rt', 'Inline', 'Inline', 'Common', array());
 
         $this->_def->addElement('rt', 'Inline', 'Inline', 'Common', array());

2016년 3월 21일 (월) 21:43 판

xe/classes/security/Purifier.class.php 의 _setConfig() 를 아래와 같이 편집한다.

	private function _setConfig()
	{
		$whiteDomainRegex = $this->_getWhiteDomainRegx();
		//$allowdClasses = array('emoticon');

		$this->_config = HTMLPurifier_Config::createDefault();
		$this->_config->set('HTML.TidyLevel', 'light');
		$this->_config->set('Output.FlashCompat', TRUE);
		$this->_config->set('HTML.SafeObject', TRUE);
		$this->_config->set('HTML.SafeEmbed', TRUE);
		$this->_config->set('HTML.SafeIframe', TRUE);
		$this->_config->set('URI.SafeIframeRegexp', $whiteDomainRegex);
		$this->_config->set('Cache.SerializerPath', $this->_cacheDir);
		$this->_config->set('Attr.AllowedFrameTargets', array('_blank'));
		//$this->_config->set('Attr.AllowedClasses', $allowdClasses);

		$this->_def = $this->_config->getHTMLDefinition(TRUE);
		
		$this->_def->addElement('ruby', 'Inline', 'Flow', 'Common', array());
        $this->_def->addElement('rp', 'Inline', 'Inline', 'Common', array());
        $this->_def->addElement('rt', 'Inline', 'Inline', 'Common', array());
        $this->_def->addElement('rb', 'Inline', 'Inline', 'Common', array());
        $this->_def->addElement('hide-contents', 'Block', 'Flow', 'Common', array());
		
	}

여기서는 ruby, rb, rp, rt, hide-contents 태그를 허용하도록 설정했다. 다른 태그를 허용하도록 설정하려면 addElement() 를 활용하도록 한다.[1]