Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#21511 closed defect (bug) (fixed)

Fatal error when upgrading from older versions

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: nacin's profile nacin
Milestone: 3.4.2 Priority: normal
Severity: normal Version: 3.3
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:

Description

Background: #18467

  1. If you try to upgrade from older versions (before self_admin_url() or esc_url() were introduced), you'll get a fatal error due to undefined functions, even if the upgrade itself was successful.

Upgrading from 2.9:

Fatal error: Call to undefined function self_admin_url() in wp-admin/includes/update-core.php on line 698

Upgrading from 2.7:

Fatal error: Call to undefined function esc_url() in wp-admin/includes/update-core.php on line 698
  1. The second placeholder in line 383 doesn't contain a position specifier:
    http://core.trac.wordpress.org/browser/tags/3.4.1/wp-admin/update-core.php#L382

This results in a wrong URL:

http://releases.wordpress/2.7/wp-admin/3.4.1

Which should be instead:

http://releases.wordpress/2.7/wp-admin/about.php?updated

Attachments (2)

21511.patch (2.7 KB) - added by SergeyBiryukov 13 years ago.
21511.2.patch (2.8 KB) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
13 years ago

A relative URL (in 21511.patch) seems to work fine in my testing.

#2 @nacin
13 years ago

We should clarify these restrictions with code comments.

This isn't a unique problem — admin-footer.php, for example, has a function_exists() call before calling get_site_option().

#3 @SergeyBiryukov
13 years ago

21511.2.patch is an attempt at the comment (similar to the one in admin-footer.php).

#4 @nacin
12 years ago

As explained in IRC, the code in wp-admin/update-core.php only runs if the current version of WordPress is >= 3.4. Otherwise, the code in admin/includes/update-core.php is run. So we only need to fix this in one place.

Will fix the strings in a separate commit.

#5 @nacin
12 years ago

In [21702]:

Don't call self_admin_url() or esc_url() when declaring that WordPress updated successfully, as they may not exist in the current (just updated) version.

props SergeyBiryukov.
see #21511.
for trunk.

#6 @nacin
12 years ago

In [21703]:

Fix placeholders in 'Welcome to WordPress' successful update messages. props SergeyBiryukov. see #21511.

#7 @nacin
12 years ago

In [21704]:

Don't call self_admin_url() or esc_url() when declaring that WordPress updated successfully, as they may not exist in the current (just updated) version.

props SergeyBiryukov.
see #21511.
for the 3.4 branch.

#8 @nacin
12 years ago

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

In [21706]:

Fix a placeholder in a string without breaking said string in a branch. fixes #21511.

Note: See TracTickets for help on using tickets.