]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/upgrade.php
Wordpress 3.6
[autoinstalls/wordpress.git] / wp-admin / includes / upgrade.php
index d22922ed781480a96357a6ca04d540a73fd2ec3b..0d17d8fce4d4ac1060364c54a380ae97a6e871cf 100644 (file)
@@ -132,7 +132,7 @@ function wp_install_defaults($user_id) {
                $first_post = get_site_option( 'first_post' );
 
                if ( empty($first_post) )
                $first_post = get_site_option( 'first_post' );
 
                if ( empty($first_post) )
-                       $first_post = stripslashes( __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ) );
+                       $first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' );
 
                $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post );
                $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post );
 
                $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post );
                $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post );
@@ -218,7 +218,7 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
        update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
        update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
-       update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array ( ), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'sidebar-2' => array ( ), 'sidebar-3' => array ( ), 'array_version' => 3 ) );
+       update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array (), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'sidebar-2' => array (),'array_version' => 3 ) );
 
        if ( ! is_multisite() )
                update_user_meta( $user_id, 'show_welcome_panel', 1 );
 
        if ( ! is_multisite() )
                update_user_meta( $user_id, 'show_welcome_panel', 1 );
@@ -433,7 +433,7 @@ function upgrade_100() {
        foreach ($categories as $category) {
                if ('' == $category->category_nicename) {
                        $newtitle = sanitize_title($category->cat_name);
        foreach ($categories as $category) {
                if ('' == $category->category_nicename) {
                        $newtitle = sanitize_title($category->cat_name);
-                       $wpdb>update( $wpdb->categories, array('category_nicename' => $newtitle), array('cat_ID' => $category->cat_ID) );
+                       $wpdb->update( $wpdb->categories, array('category_nicename' => $newtitle), array('cat_ID' => $category->cat_ID) );
                }
        }
 
                }
        }
 
@@ -636,23 +636,23 @@ function upgrade_160() {
        $users = $wpdb->get_results("SELECT * FROM $wpdb->users");
        foreach ( $users as $user ) :
                if ( !empty( $user->user_firstname ) )
        $users = $wpdb->get_results("SELECT * FROM $wpdb->users");
        foreach ( $users as $user ) :
                if ( !empty( $user->user_firstname ) )
-                       update_user_meta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) );
+                       update_user_meta( $user->ID, 'first_name', wp_slash($user->user_firstname) );
                if ( !empty( $user->user_lastname ) )
                if ( !empty( $user->user_lastname ) )
-                       update_user_meta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) );
+                       update_user_meta( $user->ID, 'last_name', wp_slash($user->user_lastname) );
                if ( !empty( $user->user_nickname ) )
                if ( !empty( $user->user_nickname ) )
-                       update_user_meta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) );
+                       update_user_meta( $user->ID, 'nickname', wp_slash($user->user_nickname) );
                if ( !empty( $user->user_level ) )
                        update_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level );
                if ( !empty( $user->user_icq ) )
                if ( !empty( $user->user_level ) )
                        update_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level );
                if ( !empty( $user->user_icq ) )
-                       update_user_meta( $user->ID, 'icq', $wpdb->escape($user->user_icq) );
+                       update_user_meta( $user->ID, 'icq', wp_slash($user->user_icq) );
                if ( !empty( $user->user_aim ) )
                if ( !empty( $user->user_aim ) )
-                       update_user_meta( $user->ID, 'aim', $wpdb->escape($user->user_aim) );
+                       update_user_meta( $user->ID, 'aim', wp_slash($user->user_aim) );
                if ( !empty( $user->user_msn ) )
                if ( !empty( $user->user_msn ) )
-                       update_user_meta( $user->ID, 'msn', $wpdb->escape($user->user_msn) );
+                       update_user_meta( $user->ID, 'msn', wp_slash($user->user_msn) );
                if ( !empty( $user->user_yim ) )
                if ( !empty( $user->user_yim ) )
-                       update_user_meta( $user->ID, 'yim', $wpdb->escape($user->user_icq) );
+                       update_user_meta( $user->ID, 'yim', wp_slash($user->user_icq) );
                if ( !empty( $user->user_description ) )
                if ( !empty( $user->user_description ) )
-                       update_user_meta( $user->ID, 'description', $wpdb->escape($user->user_description) );
+                       update_user_meta( $user->ID, 'description', wp_slash($user->user_description) );
 
                if ( isset( $user->user_idmode ) ):
                        $idmode = $user->user_idmode;
 
                if ( isset( $user->user_idmode ) ):
                        $idmode = $user->user_idmode;
@@ -854,7 +854,7 @@ function upgrade_230() {
                foreach ( $link_cats as $category) {
                        $cat_id = (int) $category->cat_id;
                        $term_id = 0;
                foreach ( $link_cats as $category) {
                        $cat_id = (int) $category->cat_id;
                        $term_id = 0;
-                       $name = $wpdb->escape($category->cat_name);
+                       $name = wp_slash($category->cat_name);
                        $slug = sanitize_title($name);
                        $term_group = 0;
 
                        $slug = sanitize_title($name);
                        $term_group = 0;
 
@@ -1279,7 +1279,7 @@ function upgrade_network() {
                update_site_option( 'ms_files_rewriting', '1' );
 
        // 3.5.2
                update_site_option( 'ms_files_rewriting', '1' );
 
        // 3.5.2
-       if ( $wp_current_db_version < 22442 ) {
+       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 = get_site_option( 'illegal_names' );
                if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {
                        $illegal_name = reset( $illegal_names );
@@ -1427,11 +1427,7 @@ function __get_option($setting) {
        if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting || 'tag_base' == $setting )
                $option = untrailingslashit( $option );
 
        if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting || 'tag_base' == $setting )
                $option = untrailingslashit( $option );
 
-       @ $kellogs = unserialize( $option );
-       if ( $kellogs !== false )
-               return $kellogs;
-       else
-               return $option;
+       return maybe_unserialize( $option );
 }
 
 /**
 }
 
 /**
@@ -1576,7 +1572,7 @@ function dbDelta( $queries = '', $execute = true ) {
 
                                // Get the default value from the array
                                        //echo "{$cfields[strtolower($tablefield->Field)]}<br>";
 
                                // Get the default value from the array
                                        //echo "{$cfields[strtolower($tablefield->Field)]}<br>";
-                               if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
+                               if (preg_match("| DEFAULT '(.*?)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
                                        $default_value = $matches[1];
                                        if ($tablefield->Default != $default_value) {
                                                // Add a query to change the column's default value
                                        $default_value = $matches[1];
                                        if ($tablefield->Default != $default_value) {
                                                // Add a query to change the column's default value
@@ -1652,7 +1648,7 @@ function dbDelta( $queries = '', $execute = true ) {
                foreach ( (array) $indices as $index ) {
                        // Push a query line into $cqueries that adds the index to that table
                        $cqueries[] = "ALTER TABLE {$table} ADD $index";
                foreach ( (array) $indices as $index ) {
                        // Push a query line into $cqueries that adds the index to that table
                        $cqueries[] = "ALTER TABLE {$table} ADD $index";
-                       $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index;
+                       $for_update[] = 'Added index ' . $table . ' ' . $index;
                }
 
                // Remove the original table creation query from processing
                }
 
                // Remove the original table creation query from processing