Make WordPress Core


Ignore:
Timestamp:
09/22/2007 12:08:50 AM (19 years ago)
Author:
markjaquith
Message:

Core and plugin update checking: make sure fsockopen() is available and check file resources with is_resource() -- both to prevent feof() infinite loops. Props xknown. fixes #5037

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/update.php

    r6026 r6151  
    4343function wp_update_plugins() {
    4444        global $wp_version;
     45
     46        if ( !function_exists('fsockopen') )
     47                return false;
     48
    4549        $plugins = get_plugins();
    4650        $active  = get_option( 'active_plugins' );
     
    8488
    8589        $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) ) {
    8791                fwrite($fs, $http_request);
    8892
Note: See TracChangeset for help on using the changeset viewer.