Fix storage of illegal_names. Add an upgrade routine to fix bad values.

props SergeyBiryukov.
see #23418.
for trunk.



git-svn-id: http://core.svn.wordpress.org/trunk@24448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-06-19 22:06:42 +00:00
parent e1923d4783
commit d80469f8a5
3 changed files with 12 additions and 2 deletions

View File

@ -1277,6 +1277,16 @@ function upgrade_network() {
// 3.5
if ( $wp_current_db_version < 21823 )
update_site_option( 'ms_files_rewriting', '1' );
// 3.5.2
if ( $wp_current_db_version < 24448 ) {
$illegal_names = get_site_option( 'illegal_names' );
if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {
$illegal_name = reset( $illegal_names );
$illegal_names = explode( ' ', $illegal_name );
update_site_option( 'illegal_names', $illegal_names );
}
}
}
// The functions we use to actually do stuff

View File

@ -2901,7 +2901,7 @@ function sanitize_option($option, $value) {
case 'illegal_names':
if ( ! is_array( $value ) )
$value = explode( "\n", $value );
$value = explode( ' ', $value );
$value = array_values( array_filter( array_map( 'trim', $value ) ) );

View File

@ -11,7 +11,7 @@ $wp_version = '3.6-beta3-24432';
*
* @global int $wp_db_version
*/
$wp_db_version = 23588;
$wp_db_version = 24448;
/**
* Holds the TinyMCE version