Changes from trunk/wp-admin/upgrade-functions.php at r4772 to branches/2.2/wp-admin/upgrade-functions.php at r5431
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/wp-admin/upgrade-functions.php
r4772 r5431 22 22 update_option('blog_public', $public); 23 23 $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 24 $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 24 25 if ( defined('WP_SITEURL') && '' != WP_SITEURL ) 26 $guessurl = WP_SITEURL; 27 else 28 $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 29 25 30 update_option('siteurl', $guessurl); 26 31 … … 171 176 upgrade_130(); 172 177 } 178 179 maybe_disable_automattic_widgets(); 173 180 174 181 if ( $wp_current_db_version < 3308 ) … … 653 660 function __get_option($setting) { 654 661 global $wpdb; 655 662 663 if ( $setting == 'home' && defined( 'WP_HOME' ) ) { 664 return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); 665 } 666 667 if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { 668 return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); 669 } 670 656 671 $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); 657 672 … … 923 938 if ($oldfile == 'index.php') { // Check to make sure it's not a new index 924 939 $index = implode('', file("$oldpath/$oldfile")); 925 if ( strstr( $index, 'WP_USE_THEMES' )) {940 if (strpos($index, 'WP_USE_THEMES') !== false) { 926 941 if (! @copy(ABSPATH . 'wp-content/themes/default/index.php', "$site_dir/$newfile")) 927 942 return false; … … 995 1010 996 1011 foreach ($stylelines as $line) { 997 if (str str($line, "Theme Name:")) $line = "Theme Name: $theme_name";998 elseif (str str($line, "Theme URI:")) $line = "Theme URI: " . __get_option('siteurl');999 elseif (str str($line, "Description:")) $line = "Description: Your theme";1000 elseif (str str($line, "Version:")) $line = "Version: 1";1001 elseif (str str($line, "Author:")) $line = "Author: You";1002 fwrite($f, "{$line}\n");1012 if (strpos($line, 'Theme Name:') !== false) $line = 'Theme Name: ' . $theme_name; 1013 elseif (strpos($line, 'Theme URI:') !== false) $line = 'Theme URI: ' . __get_option('url'); 1014 elseif (strpos($line, 'Description:') !== false) $line = 'Description: Your theme.'; 1015 elseif (strpos($line, 'Version:') !== false) $line = 'Version: 1'; 1016 elseif (strpos($line, 'Author:') !== false) $line = 'Author: You'; 1017 fwrite($f, $line . "\n"); 1003 1018 } 1004 1019 fclose($f); … … 1095 1110 } 1096 1111 1112 function maybe_disable_automattic_widgets() { 1113 $plugins = __get_option( 'active_plugins' ); 1114 1115 foreach ( (array) $plugins as $plugin ) { 1116 if ( basename( $plugin ) == 'widgets.php' ) { 1117 array_splice( $plugins, array_search( $plugin, $plugins ), 1 ); 1118 update_option( 'active_plugins', $plugins ); 1119 break; 1120 } 1121 } 1122 } 1123 1097 1124 ?>
Note: See TracChangeset
for help on using the changeset viewer.