WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#5037 closed defect (bug) (fixed)

WordPress 2.3 doesn't finish to load when fsockopen has been disabled

Reported by: xknown Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.3
Component: General Keywords: has-patch
Focuses: Cc:

Description

As the title states, WP enters in an infinite loop (line 35 wp-includes/update.php) when fsockopen is listed in disable_functions directive.

The attached patch contains an alternative to fix the problem, it also restrict update checks only when is_admin() is true.

Attachments (2)

update_checks.diff (1.0 KB) - added by xknown 7 years ago.
check if fsockopen has been disabled
5037.002.diff (1.7 KB) - added by markjaquith 7 years ago.

Download all attachments as: .zip

Change History (6)

xknown7 years ago

check if fsockopen has been disabled

comment:1 Nazgul7 years ago

  • Keywords has-patch added

comment:2 markjaquith7 years ago

Agree that we should be preventing an infinite loop -- but not that we should limit it to wp-admin. It's really close to release, let's just fix the bug.

Checking fsockopen() is good, but line 33 also troubles me because all it tests for is "false" (which obviously is failing in the case of fsockopen() being blocked). We should be testing $fs with is_resource()

markjaquith7 years ago

comment:3 xknown7 years ago

Mark, your patch is more consistent although I don't like the idea that versions checks take place on init hook.

comment:4 markjaquith7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6151]) 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

Note: See TracTickets for help on using tickets.