Make WordPress Core

Ticket #16416: 16416.2.diff

File 16416.2.diff, 2.6 KB (added by lessbloat, 11 years ago)
  • wp-includes/formatting.php

     
    27992799                        $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); // strips slashes
    28002800                        break;
    28012801
     2802                case 'blog_public' :
     2803                        // This is the value if the settings checkbox is not checked on POST. Don't rely on this.
     2804                        if ( null === $value )
     2805                                $value = 1;
     2806                        break;
     2807
    28022808                case 'date_format':
    28032809                case 'time_format':
    28042810                case 'mailserver_url':
  • wp-admin/options.php

     
    139139                        if ( $unregistered )
    140140                                _deprecated_argument( 'options.php', '2.7', sprintf( __( 'The <code>%1$s</code> setting is unregistered. Unregistered settings are deprecated. See http://codex.wordpress.org/Settings_API' ), $option, $option_page ) );
    141141
    142                         $option = trim($option);
     142                        $option = trim( $option );
    143143                        $value = null;
    144                         if ( isset($_POST[$option]) )
    145                                 $value = $_POST[$option];
    146                         if ( !is_array($value) )
    147                                 $value = trim($value);
    148                         $value = stripslashes_deep($value);
    149                         update_option($option, $value);
     144                        if ( isset( $_POST[ $option ] ) ) {
     145                                $value = $_POST[ $option ];
     146                                if ( ! is_array( $value ) )
     147                                        $value = trim( $value );
     148                                $value = stripslashes_deep( $value );
     149                        }
     150                        update_option( $option, $value );
    150151                }
    151152        }
    152153
  • wp-admin/options-reading.php

     
    148148        <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ); ?></p>
    149149        <?php do_action('blog_privacy_selector'); ?>
    150150<?php else : ?>
    151         <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> />
    152         <?php _e( 'Allow search engines to index this site' ); ?>
    153         <p class="description"><?php _e( 'It is up to search engines to honor a request to not index this site.' ); ?></p>
     151        <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
     152        <?php _e( 'Ask search engines <strong>not to</strong> index this site' ); ?></label>
     153        <p class="description"><?php _e( "It's up to search engines to honor this request." ); ?></p>
    154154<?php endif; ?>
    155155</fieldset></td>
    156156</tr>