#5465 use strlen instead of empty#5499
Conversation
|
by mistake hadn't set my global name and email address for git hence the commit coming from someone named root. |
|
@jeremyquinton test required |
|
I will commit one this evening. |
|
@Ocramius unit test as requested. |
|
Btw: |
|
@jeremyquinton Please fix the cs and this will be merged. |
|
@Maks3w when you say cs do you mean code style and are you referring to the comment above yours. |
|
@jeremyquinton yes, code style. See travis report for to see where your code is failing. |
|
@Maks3w I'm not 100% sure what trailing spaces it means but any guidance appreciated. PSR-2 https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md states I don't have any trailing whitespace that I can see |
|
will give this https://github.com/fabpot/PHP-CS-Fixer a try leave it to me |
There was a problem hiding this comment.
Shouldn't there be a strict comparison, since strlen() may return null?
There was a problem hiding this comment.
from http://uk3.php.net/strlen strlen returns null if called on an array. Is there another circumstance when strlen can return null?
I wrote this fix a couple months ago but unless $matches[3][$index] is an array at any point I think this should be ok.
I can't find the code I used to reproduce the issue. In the next week what I will do is rewrite the code to reproduce the issue and see what the value of $matches[3][$index] is to get a feel for if it can every be an array.
No description provided.