WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#29248 closed defect (bug) (fixed)

Browsers may cache 302 redirect to install.php

Reported by: smerriman Owned by: SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.9.2
Component: Upgrade/Install Keywords: has-patch commit
Focuses: Cc:
PR Number:

Description

  • Upload the Wordpress files and fill in the wp-config.php information
  • Visit the Wordpress URL in your browser; you are redirected to /wp-admin/install.php
  • Proceed with the installation
  • Visit the Wordpress URL in your browser.

Firefox, at least, caches the 302 redirect and keeps sending you to /wp-admin/install.php, acting as if you haven't installed Wordpress at all. Restarting Firefox clears the 302 cache, after which it works perfectly.

I'm not sure what the best solution is - ideally it should be redirected in a way that doesn't cache the result, if possible - but at the very least, the installation page shouldn't be acting as if Wordpress isn't installed and asking you for installation details.

Attachments (2)

29248.patch (503 bytes) - added by SergeyBiryukov 5 years ago.
29248.2.patch (1.7 KB) - added by SergeyBiryukov 5 years ago.

Download all attachments as: .zip

Change History (9)

#1 in reply to: ↑ description @SergeyBiryukov
5 years ago

Replying to smerriman:

but at the very least, the installation page shouldn't be acting as if Wordpress isn't installed and asking you for installation details.

We already detect that: tags/3.9.2/src/wp-admin/install.php#L142.

#2 @smerriman
5 years ago

Hm, I see. Every time I'm redirected to /wp-admin/install.php, I'm seeing the original installation page and form; only when I do a hard refresh of that page does it change to the 'Wordpress is already installed' message. So it's caching both the redirect, and the install.php output.

#3 @SergeyBiryukov
5 years ago

  • Keywords has-patch added

I think adding nocache_headers() to wp_not_installed() should resolve this.

Related: #21745.

#4 @johnbillion
5 years ago

  • Milestone changed from Awaiting Review to 4.0

This makes sense. We send no-cache headers on the login screen, database upgrade screens, and on the rest of the admin area.

#5 @SergeyBiryukov
5 years ago

wp_not_installed() is called unconditionally, so 29248.patch doesn't work as expected.

See 29248.2.patch.

#6 @nacin
5 years ago

  • Keywords commit added

Fine.

#7 @SergeyBiryukov
5 years ago

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

In 29599:

Send nocache_headers() on installation screens and when redirecting to them.

fixes #29248.

Note: See TracTickets for help on using tickets.