Jump to content

Allowing specific HTML tags.


jcsnider

Recommended Posts

Posted

Found the solution to my own question. Gonna write it all out here so I can find it later.

First off I ditched my CkEditor plugin and used the IPB Add Button Feature for this project.

4180d2e096c3b6c25ea14b1915178ab7.png

 

That provided a similar result. I was able to post videos as an admin but noone else could.  I finally concluded that it was the HTMLPurifier library that was blocking the video and source tags, so I removed it.  (jk jk)

Instead I found the /System/Text/Parser.php file where all of the allowed html tags are defined.  Under this line:

        $def->addAttribute( 'iframe', 'data-munge-src', 'Text' );

I added

		$def->addElement('video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array(
      			'src' => 'URI',
      			'type' => 'Text',
      			'width' => 'Length',
      			'height' => 'Length',
      			'poster' => 'URI',
      			'preload' => 'Enum#auto,metadata,none',
      			'controls' => 'Bool',
    		));
    		$def->addElement('source', 'Block', 'Flow', 'Common', array(
      			'src' => 'URI',
      			'type' => 'Text',
    		));

 

and now everything is working as intended without giving all my users the ability to write any html code they want.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...