Jimbola Posted June 12, 2011 Share Posted June 12, 2011 Hi allI'm using the Home Text Editorial Module to display and image (thats fine) but when I add a rollover image (on mouseover) and click update i get the following message The following field is invalid according to the validate method isCleanHTML:(EditorialClass->body_paragraph = for language 1)Does anyone know what that means and how to resolve it? Link to comment Share on other sites More sharing options...
shokinro Posted June 12, 2011 Share Posted June 12, 2011 but when I add a rollover image (on mouseover) and click update i get the following message I am not sure how is your "rollover image" implements, it must bed using Javascript.I don't think the editor will allow use javascript in the html. Link to comment Share on other sites More sharing options...
shokinro Posted June 12, 2011 Share Posted June 12, 2011 I just tried your scenario. it did gave the validation error.it seems the html below the error message itself is working fine.So I just try to remove the validation to let it pass. but after that, it does not save anything.to remove the validation, remove this line from file /modules/editorial/EdtorialClass.php 'body_paragraph' => 'isCleanHtml', there might be a bug here. I am not sure.I am still trying to find a solution for you. Link to comment Share on other sites More sharing options...
shokinro Posted June 12, 2011 Share Posted June 12, 2011 I think there is problem with the validation that does not pass the validation.so I just tried to bypass the validation by change Validation.php file.It did worked. see http://expresscheckout.dyndns.org:8080/shop1425//YourSiteRoot/classes/Validation.phpChange this code static public function isCleanHtml($html) { $jsEvent = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave'; return (!preg_match('/<[ \t\n]*script/i', $html) && !preg_match('/<?.*('.$jsEvent.')[ \t\n]*=/i', $html) && !preg_match('/.*script\:/i', $html)); } To this code (comment out two lines, and add one line "return true;") static public function isCleanHtml($html) { // $jsEvent = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave'; // return (!preg_match('/<[ \t\n]*script/i', $html) && !preg_match('/<?.*('.$jsEvent.')[ \t\n]*=/i', $html) && !preg_match('/.*script\:/i', $html)); return true; } But this is not a good idea, to remove the validation all the same.You can make the change temporary and save your changes, then restore that file.it is walk around, not a fix. Link to comment Share on other sites More sharing options...
Jimbola Posted June 14, 2011 Author Share Posted June 14, 2011 Thank you really helped me out. Link to comment Share on other sites More sharing options...
jmaumene Posted November 8, 2011 Share Posted November 8, 2011 It's realy an BAD IDEA ! the method iscleanHtml check the XSS... D'ont change the Validation class if you want use javascript in home text editor, change the file modules/editorial/EditorialClass.php Change this : 'body_paragraph' => 'isCleanHtml', by this : 'body_paragraph' => 'isString', 1 Link to comment Share on other sites More sharing options...
Peti_ Posted January 23, 2012 Share Posted January 23, 2012 It's realy an BAD IDEA ! the method iscleanHtml check the XSS... D'ont change the Validation class if you want use javascript in home text editor, change the file modules/editorial/EditorialClass.php Change this : 'body_paragraph' => 'isCleanHtml', by this : 'body_paragraph' => 'isString', Thanks. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now