Changeset 60928
- Timestamp:
- 10/13/2025 09:48:42 PM (2 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/plugin-editor.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/plugin-editor.php
r60681 r60928 94 94 95 95 if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) { 96 $r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); 97 if ( is_wp_error( $r ) ) { 98 $edit_error = $r; 96 $edit_result = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); 97 98 if ( is_wp_error( $edit_result ) ) { 99 $edit_error = $edit_result; 100 99 101 if ( check_ajax_referer( 'edit-plugin_' . $file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) { 100 102 $posted_content = wp_unslash( $_POST['newcontent'] ); … … 123 125 // Get the extension of the file. 124 126 if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) { 125 $ext = strtolower( $matches[1] ); 127 $extension = strtolower( $matches[1] ); 128 126 129 // If extension is not in the acceptable list, skip it. 127 if ( ! in_array( $ext , $editable_extensions, true ) ) {130 if ( ! in_array( $extension, $editable_extensions, true ) ) { 128 131 wp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) ); 129 132 }
Note: See TracChangeset
for help on using the changeset viewer.