Skip to content

WP/CronInterval: make callback function name lookup case-insensitive#2730

Open
rodrigoprimo wants to merge 2 commits into
developfrom
fix-cron-interval
Open

WP/CronInterval: make callback function name lookup case-insensitive#2730
rodrigoprimo wants to merge 2 commits into
developfrom
fix-cron-interval

Conversation

@rodrigoprimo

Copy link
Copy Markdown
Contributor

Description

The WordPress.WP.CronInterval sniff was incorrectly treating callback function names as case-sensitive when trying to locate the callback function definition. This led to false positives when the callback reference case did not match the function declaration case.

The fix ensures callback names are compared case-insensitively using strcasecmp() when searching for function declarations in the code.

Suggested changelog entry

WordPress.WP.CronInterval: false positive when the callback function reference used different casing than the function declaration.

The sniff was incorrectly treating callback function names as case-sensitive when trying to locate the callback function definition. This led to false positives when the callback reference case did not match the function declaration case.

The fix ensures callback names are compared case-insensitively using `strcasecmp()` when searching for function declarations in the code.

@jrfnl jrfnl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodrigoprimo Thanks for this PR. Looks good to me. Just one tiny nitpick.

Comment thread WordPress/Tests/WP/CronIntervalUnitTest.inc Outdated

@jrfnl jrfnl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rodrigoprimo. All good from me.

@jrfnl jrfnl added this to the 3.4.0 milestone Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants