fix: Path checking for the existence of a namespaced helper file#9350
Closed
yllumi wants to merge 1 commit intocodeigniter4:developfrom
Closed
fix: Path checking for the existence of a namespaced helper file#9350yllumi wants to merge 1 commit intocodeigniter4:developfrom
yllumi wants to merge 1 commit intocodeigniter4:developfrom
Conversation
Contributor
samsonasik
reviewed
Dec 30, 2024
| $path = $loader->locateFile($filename, 'Helpers'); | ||
|
|
||
| if ($path !== '') { | ||
| if (!$path) { |
Member
There was a problem hiding this comment.
should be strict empty string or false
Suggested change
| if (!$path) { | |
| if ($path === false || $path === '') { |
Member
There was a problem hiding this comment.
Ok, $path === false should be enough, since empty string should never happen
Suggested change
| if (!$path) { | |
| if ($path === false) { |
Member
|
@yllumi it is recommended to create a branch per PR, you can read guideline for it https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#how-to-guide Also, please provide failing test case on |
5 tasks
Member
|
@yllumi I created new PR with include test case for it: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The update in version 4.5.6 caused an error in the logic check line for the path of the namespaced helper file. The return value of
$loader->locateFileis a string containing the file path if found, andfalseif not found. TheFileNotFoundExceptionshould be executed if$pathvalue isfalse.Checklist: