Jump to content

validation.php modify after gets problem


Recommended Posts

how about a ps version, that is most helpful...maybe someone can send you a 'clean' file or get one by downloading your version and extracting that file

 

for 1.5 there is a setting to allow iframes...so if you are running 1.5 and mange to fix your 'snafu' try this

 

12.04.2013-16.21.png

http://screencast.com/t/Gx8s6Z19Q

 

ps version is 1.5.6.1  front and back office disabled

Link to comment
Share on other sites

turn on errors then and see what the issue is...that is all part of the development cycle :)

i did open debug mode

 

www.worldbazaar.com.tr

 

error is 

 

 

Fatal error: Class 'Validate' not found in /home/worldbaz/public_html/classes/ObjectModel.php on line 188

Link to comment
Share on other sites

it would seem that you do not have classes/Validate.php, or you have a bad copy of it...

 

are you using ftp?  I know some people have problems with their ftp not honoring upper case, i.e. Validate.php not validate.php

 

yes im using filezilla. and Validation.php upper cased

Link to comment
Share on other sites

boy...that is weird...I mean I've probably done this...but I have walked you through what I think should have fixed it...

 

download the Validate.php code you have on your remote server and attach it to this post, click 'more reply options' to attach.

 

hurry..my mom is calling me for dinner...jajajaja

Link to comment
Share on other sites

public static function isCleanHtml($html, $allow_iframe = false){
return $html;
}

modifiaiton will work then ;)

 

 

 

your codes will work if enabled Allow iframes on html fields ?

 

bcz when i did enable it.  its not allowing me to add youtube videos

Link to comment
Share on other sites

 

regenereate cache/class_index.php will work then.

and regarding to this problem: you used wrong code, i suppose that you used isCleanHtml without second param

 

 

howdy milos, I thought of this but I thought it was only for overrides!...thanks for helping out...

Link to comment
Share on other sites

howdy milos, I thought of this but I thought it was only for overrides!...thanks for helping out...

 

I've noticed when some class doesn't work (for example: I changed  something in Validate class I forgot about semicolon, bracket etc. Effect: Validate class is crashed) then after recompilation class_index.php hasn't got line with information about crashed Validate class, so even if we upload working class, it will not be loaded due to the fact that in class_index.php there is no information about it

 

I discovered it two days ago ;)

Link to comment
Share on other sites

  • 1 month later...

Hello prestashopers,
I have the same problem than @ps3z

He says that the problem is solved by itself?

I uploaded the Validation.php that you uploaded El Patron,

but still that msg:
Fatal error: Class 'Validate' not found in /homepages/46/d507973978/htdocs/classes/ObjectModel.php on line 188

I have the same version too,
thanks.

 

EDIT: Have cleaned the cache too.

Edited by Juanki_222 (see edit history)
Link to comment
Share on other sites

Hello prestashopers,

I have the same problem than @ps3z

He says that the problem is solved by itself?

 

I uploaded the Validation.php that you uploaded El Patron,

but still that msg:

Fatal error: Class 'Validate' not found in /homepages/46/d507973978/htdocs/classes/ObjectModel.php on line 188

 

I have the same version too,

thanks.

 

EDIT: Have cleaned the cache too.

 

try this, delete the following file using ftp or your hosting control panel

 

cache/class_index.php

  • Like 1
Link to comment
Share on other sites

Yeaaaaaah!!!

Now is working, thanks a lot El Patron :)

 

This file is the main cache of the site?? For modifications in future...

 

it is the main cache for classes...even if you had not deleted it over time it would have rebuilt itself. 

 

happy prestashopping

Link to comment
Share on other sites

  • 1 year later...

Hi

I have very common problem;

 

Fatal error: Call to undefined method Validate::isTableOrIdentifier() in /var/www/vhosts/biguzellikyapsana.com/httpdocs/classes/ObjectModel.php on line 191

Line says:

if (!Validate::isTableOrIdentifier($this->def['primary']) || !Validate::isTableOrIdentifier($this->def['table']))

 

my website works probebly except this module when it is in Turkish:

https://www.biguzellikyapsana.com/modules/facebookpsshoptab/

in English version it works fine. Module developer told that issue was related with Prestashop because they tested on other Turkish(or another) langauge setting. 

So we have some similarities could you suggest something please?

Link to comment
Share on other sites

  • 2 months later...

After upgrade to PrestaShop™ 1.5.6.3 I can't do any changes to catalog/products. Always get the error:

 

The description field (English (English)) is invalid.

The description field (Finnish) is invalid.

The short_description field (English (English)) is invalid.

The short_description field (Finnish) is invalid.

 

Can I have clear help, step by step for this problem?

Trying to change this Validate.php file, but nothing happening. I'm not sure I did it right, so I return to backup file.

Allow iframes on html fields is ON.

Deleting class_index.php - no changes.

 

Disabeling product produces error: Property Product->description is not valid

 

What do I missing?

 

-----------

 

Ok I did it, and it seems to be working.

I change Validate.php

 

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 (!$allow_iframe && preg_match('/<[\s]*(i?frame|form|input|embed|object)/ims', $html))
            return false;

        return true;
    }

 

--------

 

TO:

 

--------

 

 public static function isCleanHtml($html, $allow_iframe = false){
            return true;
/*
        $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';
        return (!preg_match('/<[ \t\n]*script/ims', $html) && !preg_match('/('.$events.')[ \t\n]*=/ims', $html) && !preg_match('/.*script\:/ims', $html));
*/
return $html;
    }

Edited by Humanoid (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...