diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e0395ad348..f44f3a7a13 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -218,8 +218,8 @@ function get_option($setting) { if ( 'home' == $setting && '' == $value ) return get_option('siteurl'); - if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting ) - $value = preg_replace('|/+$|', '', $value); + if ( in_array($setting, array('siteurl', 'home', 'category_base', 'tag_base')) ) + $value = untrailingslashit($value); return apply_filters( 'option_' . $setting, maybe_unserialize($value) ); }