Iframes not showing up in ojs 3.0.0

Thanks:

STEP-BY-STEP:

  1. edit the config.inc.php file in your ojs folder and edit the line allowed_html by adding iframe to it:

allowed_html = "a,....,iframe[frameborder|scrolling|style|src|width|height]>"

now the htmlpurifier library:
open the following file on the editor using a command:
$ pico /lib/pkp/classes/core/PKPString.inc.php
and find the line with htmlpurifier (using ctrl+W and writing htmlpurif)
edit the entry to contain these two lines:
$config->set('HTML.SafeIframe', true); $config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vimeo // This line is important allow iframe in allowed elements or it will not work

This worked for me. So there you have an updated tutorial how to include iframes.
REMEMBER THAT THESE ARE UNSAFE though.

2 Likes