WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/22/2007 12:08:50 AM (13 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-includes/update.php

    r6026 r6151  
    44
    55function 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') )
    77        return;
    88
     
    3131
    3232    $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) ) {
    3434        fwrite( $fs, $http_request );
    3535        while ( !feof( $fs ) )
Note: See TracChangeset for help on using the changeset viewer.