zytzagoo / smtp-validate-email

A PHP library for performing email addresses validation via SMTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Call to a member function format() on bool in zytzagoo\smtp-validate-email\src\Validator.php on line 942.

tobiascapin opened this issue · comments

Call to a member function format() on bool in C:\Users\Tobia\git\cinebot\SitoTicketing\vendor\zytzagoo\smtp-validate-email\src\Validator.php on line 942.

$date = \DateTime::createFromFormat('U.u', sprintf('%.f', microtime(true)))->format('Y-m-d\TH:i:s.uO');

This error is related to the decimal separator of the system. If it is other than "." it fails.

It should be replaced with:

$date = \DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->format('Y-m-d\TH:i:s.uO');

Hi, thanks for the report.
Current master/main source has something else on L942: https://github.com/zytzagoo/smtp-validate-email/blob/master/src/Validator.php#L942 -- which version are you running exactly?

Edit: After seeing the example (after your edit), this looks related to #58 and was fixed with #59 ? Can you confirm the version you are using/running currently?

I guess you're using via composer with 1.0.0 probably? Can you switch to dev-master and see if it fixes the issue?

Or you can wait for the next release, which will happen when time permits.
Need to remember how I did these things... (also probably need to see what is sitting/waiting for the release (https://github.com/zytzagoo/smtp-validate-email/blob/master/CHANGELOG.md) and decide on version numbering and whatnot...bleh)

Hi, I have used the version downloaded from composer. I looks like the 1.0.
The problem seems to be the same linked, I will try downloading from here the last version.
Thanks

Download manually, or just set version in composer.json to 'dev-master' and it should grab/install latest master as opposed to latest "stable".

Yes, with dev-master it works. No more errors. Thank you very much.