Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Aug 26, 2020

strpos expects args in the order $haystack, $needle.

additionally strpos can never return -1 but will return false when nothing can be found.

@guilliamxavier
Copy link
Contributor

The fix is correct, but actually this block is dead code (see #234 (comment), "[it] was simply merged in error after the problem was already solved"), so it should probably be deleted (in a second commit)

/ping @erayd

@DannyvdSluijs
Copy link
Collaborator

Looking into the comment from @guilliamxavier he is correct. The "typo" was introduced in ffc856d on 18/02/2016 whereas in 6474265 on 03/03/2016 the calling code of the validateDateTime with an format argument containing an u was removed making this check void. So removing the code block would be best.

@staabm thank you very much for your efforts though. Sadly the PR was never followed up. In an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Based on the above conclusion is it safe to assume this can be closed? Feel free to close it yourself with some comments if helpful. A new PR #710 was just created to remove the dead code.

@staabm
Copy link
Contributor Author

staabm commented Feb 12, 2024

Thank you guys for the analysis

@staabm staabm closed this Feb 12, 2024
@staabm staabm deleted the patch-1 branch February 12, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants