Ticket #5037: 5037.002.diff
File 5037.002.diff, 1.7 KB (added by , 17 years ago) |
---|
-
wp-includes/update.php
3 3 // A simple set of functions to check our version 1.0 update service 4 4 5 5 function wp_version_check() { 6 if ( strpos($_SERVER['PHP_SELF'], 'install.php') !== false || defined('WP_INSTALLING') )6 if ( !function_exists('fsockopen') || strpos($_SERVER['PHP_SELF'], 'install.php') !== false || defined('WP_INSTALLING') ) 7 7 return; 8 8 9 9 global $wp_version; … … 30 30 $http_request .= "\r\n"; 31 31 32 32 $response = ''; 33 if ( false !== ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3 ) ) ) {33 if ( false !== ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3 ) ) && is_resource($fs) ) { 34 34 fwrite( $fs, $http_request ); 35 35 while ( !feof( $fs ) ) 36 36 $response .= fgets( $fs, 1160 ); // One TCP-IP packet -
wp-admin/includes/update.php
42 42 43 43 function wp_update_plugins() { 44 44 global $wp_version; 45 46 if ( !function_exists('fsockopen') ) 47 return false; 48 45 49 $plugins = get_plugins(); 46 50 $active = get_option( 'active_plugins' ); 47 51 $current = get_option( 'update_plugins' ); … … 83 87 $http_request .= $request; 84 88 85 89 $response = ''; 86 if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) ) {90 if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) { 87 91 fwrite($fs, $http_request); 88 92 89 93 while ( !feof($fs) )