Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File extension comparison treats some distinct extensions as equal #98

Closed
Zenexer opened this issue May 18, 2021 · 2 comments · Fixed by #355
Closed

File extension comparison treats some distinct extensions as equal #98

Zenexer opened this issue May 18, 2021 · 2 comments · Fixed by #355
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@Zenexer
Copy link

Zenexer commented May 18, 2021

Bug Report

Q A
Version(s) HEAD (2.15.x)

Summary

Certain file extensions are considered equal by validators in some contexts. For example, Laminas\Validator\File\ExcludeExtension#isValid will treat file extensions 10 and 010 as equal (example.10 and example.010 have the same file extension in its eyes). This is a result of using == and in_array() without strict mode to check strings. The following both return true in PHP:

'10' == '010';
in_array('10', ['010']);

Expected behavior

example.10 should never be considered to have the file extension 010.

@Zenexer Zenexer added the Bug Something isn't working label May 18, 2021
fgsl added a commit to fgsl/laminas-validator that referenced this issue Jul 13, 2021
@fgsl
Copy link

fgsl commented Jul 13, 2021

#104

gsteel added a commit to gsteel/laminas-validator that referenced this issue Jul 11, 2024
Signed-off-by: George Steel <[email protected]>
@gsteel gsteel linked a pull request Jul 11, 2024 that will close this issue
gsteel added a commit to gsteel/laminas-validator that referenced this issue Jul 11, 2024
Signed-off-by: George Steel <[email protected]>
@gsteel gsteel added this to the 3.0.0 milestone Jul 11, 2024
@gsteel gsteel self-assigned this Jul 11, 2024
@gsteel
Copy link
Member

gsteel commented Jul 13, 2024

Closed via #355

@gsteel gsteel closed this as completed Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants