Make WordPress Core

Ticket #13978: 13978-fix.patch

File 13978-fix.patch, 1.7 KB (added by sean212, 14 years ago)

Try this on for size.

  • options-general.php

     
    7575<table class="form-table">
    7676<tr valign="top">
    7777<th scope="row"><label for="blogname"><?php _e('Site Title') ?></label></th>
    78 <td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" class="regular-text" /></td>
     78<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" class="regular-text" />
     79<div class="updated inline">
     80<p><?php if ( isset( $_GET['error'] ) && $_GET['error'] == 'blogname' ) {  _e('You cannot leave the site title blank.'); } ?></p>
     81</div>
     82</td>
    7983</tr>
    8084<tr valign="top">
    8185<th scope="row"><label for="blogdescription"><?php _e('Tagline') ?></label></th>
  • options.php

     
    116116                $options = $whitelist_options[ $option_page ];
    117117        }
    118118
    119         // Handle custom date/time formats
     119        //      From options sent from options-general.php.
    120120        if ( 'general' == $option_page ) {
     121                //      Checking to see if the site name is empty.
     122                if ( empty( trim( $_POST['blogname'] ) ) ) {
     123                        $goback = add_query_arg( 'error', 'blogname',  wp_get_referer() );
     124                        wp_redirect( $goback );
     125                }
     126               
     127                // Handle custom date/time formats
    121128                if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['date_format'] ) )
    122129                        $_POST['date_format'] = $_POST['date_format_custom'];
    123130                if ( !empty($_POST['time_format']) && isset($_POST['time_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['time_format'] ) )