No reason to check if $needle === “”.
endsWith has to check:
1) $haystack lenght > 0
2) strlen($haystack)>=strlen($needle)
3) strpos !== FALSE
return strlen($haystack) && ($len=strlen($haystack)-strlen($needle)) >= 0 && strpos($haystack, $needle, $len) !== FALSE;
Hope this helps and thanks for your plugin,
F.
Hi @psicosy448 and thank you for the help.
I’ll dig into it and fixing up the issue soon.
Paolo
Should be fixed now.
Can you try it?
Sure.
I’ve tried 0.7 version.
Now I’m seeing this warning:
[22-Apr-2015 07:46:02 UTC] PHP Warning: substr_compare(): The start position cannot exceed initial string length in wordstress.php on line 99
I can’t reproduce it, nothing found in access.log 🙁
I’ve got a WordPress 4.1.2 and PHP 5.4.38.
Can you please share your info details?
I’m on a WP 4.1.2 and a PHP 5.4.35.
It seems that strlen($haystack)===0 raise the Warning.
Maybe the homepage ?