Skip to content

Fatal Error running script #1

@liberatorcnx

Description

@liberatorcnx

I recently installed verifyemail on my webserver and wrote a simple test script to test functionality. I was surprised to get a fatal error message as follows:

Fatal error: Uncaught TypeError: trim() expects parameter 1 to be string, bool given in /home/tvonlin1/bin/vendor/masroore/verifyemail/src/SmtpConnection.php:704.........

On inspecting the code and adding some debug info to find the problem I discovered that this was caused by calling trim() before skipping empty strings in SmtpConnection.php. By moving line 704 ( $s = trim(substr($s, 4)); ) to be below the empty check the problem was solved.

I am surprised nobody has come across this error before. I found that most mailservers were sending an empty string as the end. Maybe there is another cause for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions