X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4..672d6bc6da735e745275ef7a86341dc1178da8d2:/wp-admin/plugin-editor.php diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index a9c534c5..8b1602c3 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -1,26 +1,40 @@ %s

', __('No such file exists! Double check the name and try again.'))); + } else { + // Get the extension of the file + if ( preg_match('/\.([^.]+)$/', $real_file, $matches) ) { + $ext = strtolower($matches[1]); + // If extension is not in the acceptable list, skip it + if ( !in_array( $ext, $editable_extensions) ) + wp_die(sprintf('

%s

', __('Files of this type are not editable.'))); + } + } + require_once('admin-header.php'); - update_recently_edited(PLUGINDIR . "/$file"); + update_recently_edited(WP_PLUGIN_DIR . '/' . $file); + + $content = file_get_contents( $real_file ); - if ( ! is_file($real_file) ) - $error = 1; + if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) { + $functions = wp_doc_link_parse( $content ); + + if ( !empty($functions) ) { + $docs_select = ''; + } + } - if ( ! $error ) - $content = htmlspecialchars(file_get_contents($real_file)); + $content = htmlspecialchars( $content ); + $codepress_lang = codepress_get_lang($real_file); ?> @@ -86,18 +128,18 @@ default:

fatal error.') ?>

- +
-
-
-

-
-
+
+ +

+ +
-%s (active)'), $file); else @@ -108,28 +150,62 @@ default: else echo sprintf(__('Browsing %s (inactive)'), $file); } - ?> + ?>
-
+
+
+ + + +

-
-

+
+ +
+

-

    - -
  • + + >
-
- -
+
+ -
+
- + +
+ +
+

Warning: Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated.'); ?>

@@ -137,23 +213,18 @@ default:

"; + echo ""; else - echo ""; + echo ""; ?>

the Codex for more information.'); ?>

- -

' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

'; - } -?> -
 
+ +
\ No newline at end of file +include("admin-footer.php");