'.__('You do not have sufficient permissions to edit templates for this blog.').'
'); $newcontent = stripslashes($_POST['newcontent']); if ( is_writeable($real_file) ) { $f = fopen($real_file, 'w+'); fwrite($f, $newcontent); fclose($f); // Deactivate so we can test it. if ( is_plugin_active($file) || isset($_POST['phperror']) ) { if ( is_plugin_active($file) ) deactivate_plugins($file, true); wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1")); exit; } wp_redirect("plugin-editor.php?file=$file&a=te"); } else { wp_redirect("plugin-editor.php?file=$file"); } exit; break; default: if ( !current_user_can('edit_plugins') ) wp_die(''.__('You do not have sufficient permissions to edit plugins for this blog.').'
'); if ( isset($_GET['liveupdate']) ) { check_admin_referer('edit-plugin-test_' . $file); $error = validate_plugin($file); if ( is_wp_error($error) ) wp_die( $error ); if ( ! is_plugin_active($file) ) activate_plugin($file, "plugin-editor.php?file=$file&phperror=1"); // we'll override this later if the plugin can be included without fatal error wp_redirect("plugin-editor.php?file=$file&a=te"); exit; } wp_enqueue_script( 'codepress' ); add_action( 'admin_print_footer_scripts', 'codepress_footer_js' ); require_once('admin-header.php'); update_recently_edited(WP_PLUGIN_DIR . '/' . $file); // List of allowable extensions $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include'); $extra_extensions = apply_filters('editable_extensions', null); if ( is_array($extra_extensions) ) $editable_extensions = array_merge($editable_extensions, $extra_extensions); if ( ! is_file($real_file) ) { $error = __('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) ) $error = __('Files of this type are not editable.'); } } if ( ! $error ) { $content = file_get_contents( $real_file ); if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) { $functions = wp_doc_link_parse( $content ); $docs_select = ''; } $content = htmlspecialchars( $content ); $codepress_lang = codepress_get_lang($real_file); } ?>fatal error.') ?>
' . $error . '