public function renderTagMedia(array $tag, array $rendererStates)
{
$mediaKey = trim($this->stringifyTree($tag['children']));
if (preg_match('#[&?"\'<>\r\n]#', $mediaKey) || strpos($mediaKey, '..') !== false)
{
return '';
}
$mediaSiteId = strtolower($tag['option']);
if ($mediaSiteId == 'youtube')
{
// youtube iframe embed bug workaround
$mediaKey = str_replace('/', '', $mediaKey);
}
if (isset($this->_mediaSites[$mediaSiteId]))
{
$embedHtml = $this->_getMediaSiteHtmlFromCallback($mediaKey, $this->_mediaSites[$mediaSiteId]);
if (!$embedHtml)
{
$embedHtml = strtr($this->_mediaSites[$mediaSiteId]['embed_html'], array(
'{$id}' => urlencode($mediaKey),
'{$id:digits}' => intval($mediaKey)
));
}
return $embedHtml;
}
else
{
return '';
}
}