Make WordPress Core

Changeset 8917


Ignore:
Timestamp:
09/17/2008 11:32:33 AM (18 years ago)
Author:
azaozz
Message:

Add nonces to quick edit, see #6815

Location:
trunk/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r8901 r8917  
    729729break;
    730730case 'inline-data':
    731         get_inline_data( explode(',', $_POST['posts']) );
     731        check_ajax_referer( 'inlineeditnonce', 'inline_edit_nonce' );
     732
     733        if ( isset($_POST['posts']) )
     734                get_inline_data( explode(',', $_POST['posts']) );
     735
    732736        die();
    733737break;
    734738case 'inline-save':
     739        check_ajax_referer( 'inlineeditnonce', 'inline_edit_nonce' );
     740       
     741        if ( ! isset($_POST['post_ID']) )
     742                exit;
     743       
    735744        inline_save_row( $_POST );
     745       
     746        $post = array();
    736747        if ( 'page' == $_POST['post_type'] ) {
    737                 $post = array();
    738748                $post[] = get_post($_POST['post_ID']);
    739                 page_rows( $post );
     749                page_rows($post);
    740750        } elseif ( 'post' == $_POST['post_type'] ) {
    741751                $mode = $_POST['post_view'];
    742                 $post = array();
    743752                $post[] = get_post($_POST['post_ID']);
    744753                post_rows($post);
  • trunk/wp-admin/includes/template.php

    r8916 r8917  
    497497                        ?>
    498498                                <td <?php echo $attributes ?>>
     499                                        <?php wp_nonce_field( 'inlineeditnonce', 'inline_edit_nonce', false ) ?>
    499500                                        <div class="title">
    500501                                                <input type="text" name="post_title" class="title" value="" /><br />
    … …  
    520521                                        <?php endif; ?>
    521522                                        <div class="clear"></div>
     523                                        <div class="save">
    522524                                        <?php
    523525                                        $actions = array();
    … …  
    532534                                        }
    533535                                        ?>
     536                                        </div>
    534537                                </td>
    535538                                <?php
  • trunk/wp-admin/js/inline-edit.js

    r8857 r8917  
    5252                return false;
    5353       
    54         jQuery.post('admin-ajax.php',
    55                 {
     54        jQuery.post('admin-ajax.php', {
     55                        'inline_edit_nonce': jQuery('#inline_edit_nonce').val(),
    5656                        action: 'inline-data',
    5757                        posts: id
    … …  
    8080        // add the new blank row
    8181        var editRow = blankRow.clone(true);
    82         jQuery(editRow).attr('id', 'edit-'+id).addClass('inline').show();
     82        jQuery(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
    8383        if(jQuery('#'+postType+'-'+id).hasClass('alternate'))
    8484                jQuery(editRow).addClass('alternate');
    … …  
    140140          id = getRowId(id);
    141141
    142         jQuery('#edit-'+id+' .check-column').html('<img src="images/loading.gif" alt="Saving..." />');
     142        jQuery('#edit-'+id+' .check-column').html('<img src="images/loading.gif" alt="" />');
    143143
    144144        var params = {
    145                 action:    'inline-save',
     145                'inline_edit_nonce': jQuery('#inline_edit_nonce').val(),
     146                action: 'inline-save',
    146147                post_type: postType,
    147                 post_ID:   id,
     148                post_ID: id,
    148149                edit_date: 'true',
    149150                post_view: postView
  • trunk/wp-admin/wp-admin.css

    r8913 r8917  
    21562156
    21572157/* Inline Editor */
    2158 
    2159 .inline {
    2160         font-size: 10px;
    2161 }
    2162 
    2163 .inline td {
     2158.inline-editor {
     2159        font-size: 11px;
     2160}
     2161
     2162.inline-editor .save {
     2163        padding-top: 5px;
     2164}
     2165
     2166.inline-editor td {
    21642167        padding-right: 4px;
    21652168        padding-left: 7px;
    21662169}
    21672170
    2168 .inline input, .inline select, .inline textarea {
     2171.inline-editor input, .inline-editor select, .inline-editor textarea {
    21692172        font-size: 10px !important;
    21702173        padding: 2px;
    … …  
    21722175}
    21732176
    2174 .inline td.date {
     2177.inline-editor td.date {
    21752178        width: 87px;
    21762179}
    21772180
    2178 .inline td.page-title {
     2181.inline-editor td.page-title {
    21792182        width: 495px;
    21802183}
    21812184
    2182 .inline td.post-title input.title {
     2185.inline-editor td.post-title input.title {
    21832186        width: 250px;
    21842187}
    21852188
    2186 .inline td.post-title input.slug {
     2189.inline-editor td.post-title input.slug {
    21872190        width: 222px;
    21882191        float: right;
    21892192}
    21902193
    2191 .inline div.title {
    2192         float: left;
    2193 }
    2194 
    2195 .inline div.title input.title {
     2194.inline-editor div.title {
     2195        float: left;
     2196}
     2197
     2198.inline-editor div.title input.title {
    21962199        font-size: 12px !important;
    21972200}
    21982201
    2199 .inline div.title label {
     2202.inline-editor div.title label {
    22002203        float: left;
    22012204        margin-top: 4px;
    22022205}
    22032206
    2204 .inline td.page-title input.slug {
     2207.inline-editor td.page-title input.slug {
    22052208        width: 123px;
    22062209        float: right;
    22072210}
    22082211
    2209 .inline div.other, .inline div.more {
     2212.inline-editor div.other, .inline-editor div.more {
    22102213        width: 190px;
    22112214        float: left;
    … …  
    22132216}
    22142217
    2215 .inline div.other label, .inline div.more label {
     2218.inline-editor div.other label, .inline-editor div.more label {
    22162219        display: block; float: left;
    22172220        width: 54px;
    … …  
    22192222}
    22202223
    2221 .inline div.other select {
     2224.inline-editor div.other select {
    22222225        width: 133px;
    22232226}
    22242227
    2225 .inline div.more {
     2228.inline-editor div.more {
    22262229        width: 125px;
    22272230}
    22282231
    2229 .inline div.more input {
     2232.inline-editor div.more input {
    22302233        width: 60px;
    22312234}
    22322235
    2233 .inline td.author select {
     2236.inline-editor td.author select {
    22342237        width: 110px;
    22352238}
    22362239
    2237 .inline ul.categories {
     2240.inline-editor ul.categories {
    22382241        list-style: none;
    22392242        padding: 0; margin: 0;
    … …  
    22432246}
    22442247
    2245 .inline ul.categories ul.children {
     2248.inline-editor ul.categories ul.children {
    22462249        list-style: none;
    22472250        padding-left: 15px;
    22482251}
    22492252
    2250 .inline ul.categories li {
     2253.inline-editor ul.categories li {
    22512254        margin-bottom: 2px;
    22522255}
    22532256
    2254 .inline ul.categories input {
     2257.inline-editor ul.categories input {
    22552258        vertical-align: middle;
    22562259        padding: 0; border: 0;
    22572260}
    22582261
    2259 .inline td.tags textarea {
     2262.inline-editor td.tags textarea {
    22602263        height: 58px; width: 100%;
    22612264}
    22622265
    2263 .inline td.comments {
     2266.inline-editor td.comments {
    22642267        padding-left: 0;
    22652268}
    22662269
    2267 .inline td.status select {
     2270.inline-editor td.status select {
    22682271        width: 98px;
    22692272}
    22702273
    2271 .inline td.status input {
     2274.inline-editor td.status input {
    22722275        vertical-align: middle;
    22732276}
Note: See TracChangeset for help on using the changeset viewer.