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

RestrictedPHPFunctions: add error for use of date() #1714

Merged
merged 1 commit into from Jun 27, 2019

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented May 28, 2019

As this sniff is already included in the WP Core ruleset and the enhancement request is about PHP native functions, this seemed liked a logical sniff to add this to.

I've elected to make this an error instead of a warning as the code within WP Core has been cleaned up for this issue now and it would be good to prevent new instances of date() creeping in.

Fixes #1713

@jrfnl jrfnl added Type: Enhancement Status: Review ready Component: Core Focus: WP interoperability Doing things the WP way, prefer using WP functionality over userland/PHP native labels May 28, 2019
@jrfnl jrfnl added this to the 2.x Next milestone May 28, 2019
@jrfnl
Copy link
Member Author

jrfnl commented May 28, 2019

Question: Should this be added to the handbook ? /cc @ntwb @pento

As this sniff is already included in the WP Core ruleset and the enhancement request is about PHP native functions, this seemed liked a logical sniff to add this to.

I've elected to make this an `error` instead of a `warning` as the code within WP Core has been cleaned up for this issue now and it would be good to prevent new instances of `date()` creeping in.

Fixes 1713
@jrfnl jrfnl force-pushed the feature/1713-restrictedphpfunctions-add-date branch from 9eb5d49 to d0b9d93 Compare June 27, 2019 14:04
@jrfnl
Copy link
Member Author

jrfnl commented Jun 27, 2019

Rebased to get a passing build after the move. @GaryJones Feel free to merge this if all is good.

Question: Should this be added to the handbook ?

@ntwb @pento Had a chance to have a look at this yet ?

@GaryJones GaryJones merged commit 20c735a into develop Jun 27, 2019
@GaryJones GaryJones deleted the feature/1713-restrictedphpfunctions-add-date branch June 27, 2019 21:10
@jrfnl jrfnl added Focus: DateTime and removed Focus: WP interoperability Doing things the WP way, prefer using WP functionality over userland/PHP native labels Oct 4, 2019
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.

Discourage date() in favor of gmdate()
2 participants