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

Disallow mkdir in favor of wp_mkdir_p #1895

Closed
kkmuffme opened this issue May 9, 2020 · 5 comments
Closed

Disallow mkdir in favor of wp_mkdir_p #1895

kkmuffme opened this issue May 9, 2020 · 5 comments

Comments

@kkmuffme
Copy link

kkmuffme commented May 9, 2020

Is your feature request related to a problem?

Disallow mkdir in favor of wp_mkdir_p

To allow for extendability of the mkdir via wp_mkdir_p, to ensure the directories are automatically created with correct permissions (& also ensures that devs dont even try to "0777" work around)

@rodrigoprimo
Copy link
Contributor

@jrfnl, I was looking for good first issues to contribute to this repository and I found this one. Is the idea of this issue to add mkdir to the list of functions in WordPress.PHP.RestrictedPHPFunctions?

I noticed that mkdir is already flagged by WordPress.WP.AlternativeFunctions. Mentioning this in case it was not considered already.

Thanks

@jrfnl
Copy link
Member

jrfnl commented Jun 9, 2024

@rodrigoprimo Maybe you should ask the OP instead of me ?

It may also be that this was fixed already without anyone noticing that this issue could be closed.

@kkmuffme
Copy link
Author

@rodrigoprimo if it's already in WordPress.WP.AlternativeFunctions this might have been fixed in the meantime.

Can you confirm that you get an error for code like:

mkdir( ABSPATH . '/testing' );

If yes, this issue can be closed

@dingo-d
Copy link
Member

dingo-d commented Jun 13, 2024

You will get a warning

File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: mkdir(). (WordPress.WP.AlternativeFunctions.file_system_operations_mkdir)

So I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants