5 public $name =
'LocalIframe';
9 if (strstr($sHtml,
'<iframe')) {
10 $sHtml = str_ireplace(
"</iframe>",
"", $sHtml);
11 if (preg_match_all(
"/<iframe(.*?)>/si", $sHtml,
$aResult)) {
13 preg_match(
'/width="([0-9]+)"/', $sItem, $width);
15 preg_match(
'/height="([0-9]+)"/', $sItem, $height);
16 $iHeight = $height[1];
17 $sWsbUrl = preg_quote(CH_WSB_URL_ROOT);
20 if (preg_match(
"#({$sWsbUrl}[a-zA-Z0-9_=\-\?\&\/]+)#", $sItem, $aMatches))
21 $sIframeUrl = $aMatches[1];
22 if (preg_match(
"#src=\"(((?!//)(?![a-z]+://)(?![a-z]+://))[a-zA-Z0-9_=\-\?\&\/]+)#", $sItem, $aMatches))
23 $sIframeUrl = $aMatches[1];
26 $sHtml = str_replace(
$aResult[0][$key],
'<img class="LocalIframe" width="' . $iWidth .
'" height="' . $iHeight .
'" src="' . $sIframeUrl .
'">', $sHtml);
35 $sPostRegex =
'#<img class="LocalIframe" ([^>]+)>#';
36 $sHtml = preg_replace_callback($sPostRegex, array($this,
'postFilterCallback'), $sHtml);
42 return '<iframe frameborder="0" allowfullscreen ' . $aMatches[1] .
'></iframe>';