patch secure: b7c557f44e
This commit is contained in:
parent
fe5342038d
commit
d34933149f
1 changed files with 70 additions and 69 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
if (!defined('_GNUBOARD_'))
|
||||||
|
exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
//https://stackoverflow.com/questions/4739284/htmlpurifier-iframe-vimeo-and-youtube-video
|
//https://stackoverflow.com/questions/4739284/htmlpurifier-iframe-vimeo-and-youtube-video
|
||||||
/**
|
/**
|
||||||
|
|
@ -7,7 +8,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||||
* Iframe filter that does some primitive whitelisting in a somewhat recognizable and tweakable way
|
* Iframe filter that does some primitive whitelisting in a somewhat recognizable and tweakable way
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
|
if (!class_exists('HTMLPurifier_Filter_Iframevideo')) {
|
||||||
class HTMLPurifier_Filter_Iframevideo extends HTMLPurifier_Filter
|
class HTMLPurifier_Filter_Iframevideo extends HTMLPurifier_Filter
|
||||||
{
|
{
|
||||||
public $name = 'Iframevideo';
|
public $name = 'Iframevideo';
|
||||||
|
|
@ -34,7 +35,7 @@ if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
|
||||||
public function trust_url_match($matches)
|
public function trust_url_match($matches)
|
||||||
{
|
{
|
||||||
$str = $matches[0];
|
$str = $matches[0];
|
||||||
if( $matches[1] ){
|
if ($matches[1]) {
|
||||||
$str = preg_replace('#<iframe#i', '<img class="Iframevideo"', $str);
|
$str = preg_replace('#<iframe#i', '<img class="Iframevideo"', $str);
|
||||||
$str = preg_replace('#</iframe>#i', '</img>', $str);
|
$str = preg_replace('#</iframe>#i', '</img>', $str);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue