Ticket #16416: 16416.2.diff

File 16416.2.diff, 2.6 KB (added by lessbloat, 8 months ago)
Line 
1Index: wp-includes/formatting.php
2===================================================================
3--- wp-includes/formatting.php  (revision 21844)
4+++ wp-includes/formatting.php  (working copy)
5@@ -2799,6 +2799,12 @@
6                        $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); // strips slashes
7                        break;
8 
9+               case 'blog_public' :
10+                       // This is the value if the settings checkbox is not checked on POST. Don't rely on this.
11+                       if ( null === $value )
12+                               $value = 1;
13+                       break;
14+
15                case 'date_format':
16                case 'time_format':
17                case 'mailserver_url':
18Index: wp-admin/options.php
19===================================================================
20--- wp-admin/options.php        (revision 21844)
21+++ wp-admin/options.php        (working copy)
22@@ -139,14 +139,15 @@
23                        if ( $unregistered )
24                                _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 ) );
25 
26-                       $option = trim($option);
27+                       $option = trim( $option );
28                        $value = null;
29-                       if ( isset($_POST[$option]) )
30-                               $value = $_POST[$option];
31-                       if ( !is_array($value) )
32-                               $value = trim($value);
33-                       $value = stripslashes_deep($value);
34-                       update_option($option, $value);
35+                       if ( isset( $_POST[ $option ] ) ) {
36+                               $value = $_POST[ $option ];
37+                               if ( ! is_array( $value ) )
38+                                       $value = trim( $value );
39+                               $value = stripslashes_deep( $value );
40+                       }
41+                       update_option( $option, $value );
42                }
43        }
44 
45Index: wp-admin/options-reading.php
46===================================================================
47--- wp-admin/options-reading.php        (revision 21844)
48+++ wp-admin/options-reading.php        (working copy)
49@@ -148,9 +148,9 @@
50        <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>
51        <?php do_action('blog_privacy_selector'); ?>
52 <?php else : ?>
53-       <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> />
54-       <?php _e( 'Allow search engines to index this site' ); ?>
55-       <p class="description"><?php _e( 'It is up to search engines to honor a request to not index this site.' ); ?></p>
56+       <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
57+       <?php _e( 'Ask search engines <strong>not to</strong> index this site' ); ?></label>
58+       <p class="description"><?php _e( "It's up to search engines to honor this request." ); ?></p>
59 <?php endif; ?>
60 </fieldset></td>
61 </tr>