Ticket #42609: 42609.1.patch
File 42609.1.patch, 822 bytes (added by , 7 years ago) |
---|
-
wp-admin/includes/file.php
385 385 return new WP_Error( 'invalid_plugin' ); 386 386 } 387 387 388 if ( 0 !== validate_file( $file, get_plugin_files( $plugin) ) ) {388 if ( ! in_array( validate_file( $file, get_plugin_files( $plugin ) ), array( 0, 2 ) ) ) { 389 389 return new WP_Error( 'bad_plugin_file_path', __( 'Sorry, that file cannot be edited.' ) ); 390 390 } 391 391 … … 445 445 } 446 446 } 447 447 448 if ( 0 !== validate_file( $real_file, $allowed_files) ) {448 if ( ! in_array( validate_file( $real_file, $allowed_files ), array( 0, 2 ) ) ) { 449 449 return new WP_Error( 'disallowed_theme_file', __( 'Sorry, that file cannot be edited.' ) ); 450 450 } 451 451