Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#13107 closed defect (bug) (fixed)

Failure to load popular tags results in PHP errors in plugin-install.php

Reported by: solarissmoke's profile solarissmoke Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Administration Keywords:
Focuses: Cc:


Steps to reproduce:

  1. Block server access to Wordpress servers (simulating what happens when plugins_api() fails to connect to them)
  1. Visit plugins install page (wp-admin/plugin-install.php)


Undefined index: name in \wplatest\wp-admin\includes\plugin-install.php on line 147 
Undefined index: name in \wplatest\wp-admin\includes\plugin-install.php on line 149
etc etc..

I think the problem is on line 67 of plugin-install.php. If an error occurs, install_popular tags is returning a WP_Error object. But the calling function is expecting an array of tags, and doesn't check that the array is valid before attempting to walk it.

Attachments (1)

13107.patch (372 bytes) - added by solarissmoke 14 years ago.
Return false instead of WP_Error object when plugins_api fails

Download all attachments as: .zip

Change History (3)

#1 @solarissmoke
14 years ago

I should add that this also requires the wporg_popular_tags option to be stale, otherwise a web query will not take place.

14 years ago

Return false instead of WP_Error object when plugins_api fails

#2 @dd32
14 years ago

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

wordpress: dd32 * r14228 /trunk/wp-admin/includes/plugin-install.php: Handle HTTP errors on popular tags requests, Handle HTTP Errors on listing loading slightly different no-js compatible. Fixes #13107

Note: See TracTickets for help on using tickets.