Jump to content

Adding PDF file to CMS page


scatty

Recommended Posts

Hi,

i am trying to add pdf file to my CMS page. I have uploaded it to SlideShare and i have embed code. It is in iframe. I tried opening CMS page editor and in this editor open "cource code" and add it, but I can't save it because it's invalid content.
So I want to add this embed code to source code manually but i dont know what file is it?
Thank you for any help,
Scatty

Link to comment
Share on other sites

  • 2 weeks later...

iframes are not allowed by default you could write an override of Validate.php changing the function isCleanHtml to always allow iframes.

 

where can I find that "validate.php" ?

 

Is there any other ways to import slideshare?

Link to comment
Share on other sites

create the folders and the file override/classes/Validate.php

 

paste inside the file this:

class Validate extends ValidateCore {
        public static function isCleanHtml($html, $allow_iframe = false)
	{
		$events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange';
		$events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend';
		$events .= '|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onmove';
		$events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel';
		$events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart';
		$events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange';
		$events .= '|onselectstart|onstart|onstop';

		if (preg_match('/<[\s]*script/ims', $html) || preg_match('/('.$events.')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html))
			return false;

		if (false && preg_match('/<[\s]*(i?frame|form|input|embed|object)/ims', $html))
			return false;

		return true;
	}
}

after that clear preastoshop cache

 

i don't know if there is any other way

 

ignore this! listen to vekia below! I totally forgot that option!! :blink::ph34r:

Edited by misthero (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...