forumfive icon indicating copy to clipboard operation
forumfive copied to clipboard

Allow for embedding of pictures from all websites

Open s4ke opened this issue 8 years ago • 0 comments

Currently embedding only works for youtube and vimeo. I guess that was implemented to work for videos only. A simple check while puryfing would help:

if($html->nodeName != 'img' && $attribute->name == 'src') {
    $domain = parse_url($value, PHP_URL_HOST);
    // Only EVER allow embeds from Youtube / Vimeo
    if( ! $domain OR ! in_array($domain, static::$video_sites)) {
        $html->removeAttributeNode($attribute);
    }
    continue;
}

s4ke avatar Sep 16 '15 11:09 s4ke