Update some old upgrade functions to use untrailingslashit().
git-svn-id: http://svn.automattic.com/wordpress/trunk@19690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5fbd6657f4
commit
c94b474b17
|
@ -1362,13 +1362,11 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
|
|||
*/
|
||||
function get_alloptions_110() {
|
||||
global $wpdb;
|
||||
$all_options = new stdClass;
|
||||
if ( $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ) ) {
|
||||
foreach ( $options as $option ) {
|
||||
// "When trying to design a foolproof system,
|
||||
// never underestimate the ingenuity of the fools :)" -- Dougal
|
||||
if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
|
||||
if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
|
||||
if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
|
||||
if ( 'siteurl' == $option->option_name || 'home' == $option->option_name || 'category_base' == $option->option_name )
|
||||
$option->option_value = untrailingslashit( $option->option_value );
|
||||
$all_options->{$option->option_name} = stripslashes( $option->option_value );
|
||||
}
|
||||
}
|
||||
|
@ -1387,21 +1385,19 @@ function get_alloptions_110() {
|
|||
function __get_option($setting) {
|
||||
global $wpdb;
|
||||
|
||||
if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
|
||||
return preg_replace( '|/+$|', '', WP_HOME );
|
||||
}
|
||||
if ( $setting == 'home' && defined( 'WP_HOME' ) )
|
||||
return untrailingslashit( WP_HOME );
|
||||
|
||||
if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
|
||||
return preg_replace( '|/+$|', '', WP_SITEURL );
|
||||
}
|
||||
if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) )
|
||||
return untrailingslashit( WP_SITEURL );
|
||||
|
||||
$option = $wpdb->get_var( $wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting ) );
|
||||
|
||||
if ( 'home' == $setting && '' == $option )
|
||||
return __get_option( 'siteurl' );
|
||||
|
||||
if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting )
|
||||
$option = preg_replace('|/+$|', '', $option);
|
||||
if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting || 'tag_base' == $setting )
|
||||
$option = untrailingslashit( $option );
|
||||
|
||||
@ $kellogs = unserialize( $option );
|
||||
if ( $kellogs !== false )
|
||||
|
|
Loading…
Reference in New Issue