We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
File upload to custom folder in uploads folder is not allowed when using Themosis framework.
File upload should succeed.
File upload fails.
Add a filter to RWMB_File_Field::handle_upload_custom_dir to allow third parties to override the following check:
RWMB_File_Field::handle_upload_custom_dir
// Make sure upload dir is inside WordPress. $upload_dir = wp_normalize_path( untrailingslashit( $field['upload_dir'] ) ); $root = wp_normalize_path( untrailingslashit( ABSPATH ) ); if ( 0 !== strpos( $upload_dir, $root ) ) { return; }
Default Themosis setup gives me something like this: $root - /var/www/my-themosis-site/htdocs/cms $upload_dir - /var/www/my-themosis-site/htdocs/content/uploads
$root
$upload_dir
I suggest to add the following filter to allow Themosis developers to implement exception for this.
// Make sure upload dir is inside WordPress. $upload_dir = wp_normalize_path( untrailingslashit( $field['upload_dir'] ) ); $root = wp_normalize_path( untrailingslashit( ABSPATH ) ); $inside_wp = (0 === strpos( $upload_dir, $root )); if ( ! apply_filters( 'rwmb_file_inside_wp', $inside_wp, $upload_dir, $root) ) { return; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue Overview
File upload to custom folder in uploads folder is not allowed when using Themosis framework.
Steps to Reproduce (for bugs)
Expected Behavior
File upload should succeed.
Current Behavior
File upload fails.
Possible Solution
Add a filter to
RWMB_File_Field::handle_upload_custom_dir
to allow third parties to override the following check:Default Themosis setup gives me something like this:
$root
- /var/www/my-themosis-site/htdocs/cms$upload_dir
- /var/www/my-themosis-site/htdocs/content/uploadsI suggest to add the following filter to allow Themosis developers to implement exception for this.
The text was updated successfully, but these errors were encountered: