Jump to content

(Warning) checkdate() expects parameter 1 to be long, string given


kirubanidhi

Recommended Posts

How to resolve this problem. I am using prestasshop version 1.5.6.

Errors.csv file:

"24 Oct 2017 18:36:33","/home2/prestashop1.5.6/public_html/controllers/front/AuthController.php:
539","(Warning) checkdate() expects parameter 1 to be long, string given"

Code:

        if (!@checkdate(Tools::getValue('months'), Tools::getValue('days'), Tools::getValue('years')) && !(Tools::getValue('months') == '' && Tools::getValue('days') == '' && Tools::getValue('years') == ''))
            $this->errors[] = Tools::displayError('Invalid date of birth');

 

 

 

Link to comment
Share on other sites

  • 6 months later...

Resolved this problem while changing the code from AuthController.php

 

if (!@checkdate((int)Tools::getValue('months'), (int)Tools::getValue('days'), (int)Tools::getValue('years')) && !(Tools::getValue('months') == '' && Tools::getValue('days') == '' && Tools::getValue('years') == ''))
            $this->errors[] = Tools::displayError('Invalid date of birth');

 

Typecast are applied when getting value from DB.

Link to comment
Share on other sites

Just now, kirubanidhi said:

Resolved this problem while changing the code from AuthController.php

 

if (!@checkdate((int)Tools::getValue('months'), (int)Tools::getValue('days'), (int)Tools::getValue('years')) && !(Tools::getValue('months') == '' && Tools::getValue('days') == '' && Tools::getValue('years') == ''))
            $this->errors[] = Tools::displayError('Invalid date of birth');

 

Typecast are applied when getting value from DB.

 

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...