Make WordPress Core

Changeset 1421


Ignore:
Timestamp:
06/13/2004 05:02:44 PM (22 years ago)
Author:
rboren
Message:

Preserve a 1.2 era version of get_alloptions as get_alloptions_110() so that upgrade_110() does not produce db errors due to version 1.3 specific changes to get_alloptions. ​http://mosquito.wordpress.org/bug_view_page.php?bug_id=0000037

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-functions.php

    r1411 r1421  
    7272    }
    7373    return false;
     74}
     75
     76
     77// get_alloptions as it was for 1.2.
     78function get_alloptions_110() {
     79        global $wpdb;
     80        if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) {
     81                foreach ($options as $option) {
     82                        // "When trying to design a foolproof system,
     83                        //  never underestimate the ingenuity of the fools :)" -- Dougal
     84                        if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
     85                        if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
     86                        if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
     87                        $all_options->{$option->option_name} = stripslashes($option->option_value);
     88                }
     89        }
     90        return $all_options;
    7491}
    7592
    … …  
    732749
    733750        // Get the GMT offset, we'll use that later on
    734         $all_options = get_alloptions();
     751        $all_options = get_alloptions_110();
     752
    735753        $time_difference = $all_options->time_difference;
    736754
Note: See TracChangeset for help on using the changeset viewer.