Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugin-editor.php

    r17183 r15132  
    1010require_once('./admin.php');
    1111
    12 if ( is_multisite() && ! is_network_admin() ) {
    13     wp_redirect( network_admin_url( 'plugin-editor.php' ) );
    14     exit();
    15 }
    16 
    1712if ( !current_user_can('edit_plugins') )
    1813    wp_die( __('You do not have sufficient permissions to edit plugins for this site.') );
     
    7368            exit;
    7469        }
    75         wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
    76     } else {
    77         wp_redirect( self_admin_url("plugin-editor.php?file=$file&scrollto=$scrollto") );
     70        wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
     71    } else {
     72        wp_redirect("plugin-editor.php?file=$file&scrollto=$scrollto");
    7873    }
    7974    exit;
     
    9085            wp_die( $error );
    9186
    92         if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network($file) ) || ! is_plugin_active($file) )
     87        if ( ! is_plugin_active($file) )
    9388            activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error
    9489
    95         wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
     90        wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
    9691        exit;
    9792    }
     
    117112        '<p>' . __('Choose a plugin to edit from the menu in the upper right and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don&#8217;t forget to save your changes (Update File) when you&#8217;re finished.') . '</p>' .
    118113        '<p>' . __('The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Lookup takes you to a web page about that particular function.') . '</p>' .
    119         '<p>' . __('If you want to make changes but don&#8217;t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.') . '</p>' .
    120         ( is_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : '' ) .
     114        '<p>' . __('If you want to make changes but don&#8217;t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit a plugin or start from scratch, check out the links below.') . '</p>' .
    121115        '<p><strong>' . __('For more information:') . '</strong></p>' .
    122116        '<p>' . __('<a href="http://codex.wordpress.org/Plugins_Editor_SubPanel" target="_blank">Documentation on Editing Plugins</a>') . '</p>' .
    123         '<p>' . __('<a href="http://codex.wordpress.org/Writing_a_Plugin" target="_blank">Documentation on Writing Plugins</a>') . '</p>' .
    124117        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    125118    );
    126119
    127     require_once(ABSPATH . 'wp-admin/admin-header.php');
     120    require_once('./admin-header.php');
    128121
    129122    update_recently_edited(WP_PLUGIN_DIR . '/' . $file);
     
    144137    }
    145138
    146     $content = esc_textarea( $content );
     139    $content = htmlspecialchars( $content );
    147140    ?>
    148141<?php if (isset($_GET['a'])) : ?>
     
    193186?>
    194187        </select>
    195         <?php submit_button( __( 'Select' ), 'button', 'Submit', false ); ?>
     188        <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />
    196189    </form>
    197190</div>
     
    237230    <p class="submit">
    238231    <?php
    239         if ( isset($_GET['phperror']) ) {
    240             echo "<input type='hidden' name='phperror' value='1' />";
    241             submit_button( __( 'Update File and Attempt to Reactivate' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) );
    242         } else {
    243             submit_button( __( 'Update File' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) );
    244         }
     232        if ( isset($_GET['phperror']) )
     233            echo "<input type='hidden' name='phperror' value='1' /><input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File and Attempt to Reactivate') . "' tabindex='2' />";
     234        else
     235            echo "<input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File') . "' tabindex='2' />";
    245236    ?>
    246237    </p>
     
    262253    break;
    263254}
    264 include(ABSPATH . "wp-admin/admin-footer.php");
     255include("./admin-footer.php");
Note: See TracChangeset for help on using the changeset viewer.