PHP Warning caused by Letter Avatar
-
I just noticed a bunch of warnings in my server log:
AH01071: Got error ': strlen() expects parameter 1 to be string, object given in /var/www/clients/client1/web2/web/wp-includes/formatting.php on line 2891
This only happens on pages with one or more comments. So I checked what is going on and found out, that the cause is a call of
is_email()
where the first parameter is not a string.I found the use of
is_email()
inletter-avatars/lib/ltrav-frontend.php
, line 429:if ( is_email($id_or_email) ) :
The problem here is, that
$id_or_email
may not always be a string – and in this case, a warning will be triggered insideis_email()
which expects strings.I added a check, if
$id_or_email
is actually a string to avoid these warnings:if ( is_string($id_or_email) && is_email($id_or_email) ) :
This stopped the warnings. It would be nice to include this change to the next update.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘PHP Warning caused by Letter Avatar’ is closed to new replies.