Repository navigation
Fix copyright notice detection for relative file paths - #509
Open
martatorredev wants to merge 1 commit into
Open
martatorredev wants to merge 1 commit into
martatorredev wants to merge 1 commit into
Conversation
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
Fixes false positives in
Copyright_Notice_Checkwhen theme file paths are relative.Previously, three
stripos()calls used implicit boolean evaluation. When a filename matched at position0, PHP treated the result asfalse, causing valid copyright notices to be ignored.This change uses strict
false !== stripos()comparisons, consistent with the existinglicense.txtcheck.Testing
Manually tested seven cases:
style.css,readme.txt,readme.mdandlicense.txt.style.csspath.All seven cases passed.
PHP syntax validation and
git diff --checkpassed.PHP_CodeSniffer reports four pre-existing violations in this file; the patch introduces no new violations.
Additional context
This issue was identified while investigating #481. However, the original reported false positive could not be reproduced with Oenology 3.5.2, so this PR only claims to address the confirmed relative-path bug.