Home > Back-end >  An uncaught Exception was encountered when i click on forget password to send email
An uncaught Exception was encountered when i click on forget password to send email

Time:11-25

i am getting this error

An uncaught Exception was encountered Type: Error

Message: Call to undefined method CI_Form_validation::substr()

Filename: /home/thedevel/public_html/esports/new/system/libraries/Form_validation.php

Line Number: 1065

Backtrace:

File: /home/thedevel/public_html/esports/new/application/controllers/Login.php Line: 495 Function: run

File: /home/thedevel/public_html/esports/new/index.php Line: 275 Function: require_once

here is the code of

Filename: /home/thedevel/public_html/esports/new/system/libraries/Form_validation.php

Line Number: 1065

public function valid_email($email) {
        if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46') && $atpos = strpos($email, '@')) {
            $email = self::substr($email, 0,   $atpos) . idn_to_ascii(self::substr($email, $atpos), 0, INTL_IDNA_VARIANT_UTS46);
        }
        return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
    }

Please help

CodePudding user response:

Are you sure with the self::substr ? It should be this :

public function valid_email($email) {
        if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46') && $atpos = strpos($email, '@')) {
            $email = substr($email, 0,   $atpos) . idn_to_ascii(substr($email, $atpos), 0, INTL_IDNA_VARIANT_UTS46);
        }
        return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
    }
  • Related