WordPress.org

Make WordPress Core

Ticket #7552: datetime-selector-bugfix.patch

File datetime-selector-bugfix.patch, 952 bytes (added by Viper007Bond, 6 years ago)

If custom field left blank, leave blank rather than "\c\u\s\t\o\m"

  • wp-admin/options.php

     
    5555 
    5656        // Handle custom date/time formats 
    5757        if ( 'general' == $option_page ) { 
    58                 if ( !empty($_POST['date_format']) && !empty($_POST['date_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['date_format'] ) ) 
     58                if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['date_format'] ) ) 
    5959                        $_POST['date_format'] = $_POST['date_format_custom']; 
    60                 if ( !empty($_POST['time_format']) && !empty($_POST['time_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['time_format'] ) ) 
     60                if ( !empty($_POST['time_format']) && isset($_POST['time_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['time_format'] ) ) 
    6161                        $_POST['time_format'] = $_POST['time_format_custom']; 
    6262        } 
    6363