WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 3 months ago

#19686 new defect (bug)

404 - File or directory not found

Reported by: kwgagel Owned by:
Milestone: Awaiting Review Priority: low
Severity: normal Version: 3.3
Component: Permalinks Keywords: dev-feedback
Focuses: multisite Cc:

Description

We are running Wordpress using multiuser with Buddypress. Users are getting the 404 error after they click the save button in their settings.

I'm opening this ticket to report the source of the problem.

Wordpress 3.x
Buddypress 1.5
Windows 2008 R2 (IIS 7.5)

Themes installed are all Buddypress compatible and all themes seem to be affected.
All option pages are affected.
Settings are updated when the user returns to the page - despite the error. A screen shot of the error can be seen at http://blogs.cnc.bc.ca/gagel/?attachment_id=38

The source of the problem appears to be in the wp_get_referer() function on line 164 in options.php. With the variables passed to the function it should redirect the user to the page they just submitted when they updated options. Instead they get the 404 error.

The page they're redirected to appears to be the absolute path of the submitted page appended to the absolute path again (minus the domain). So it looks like this:
userblog/wp-admin/userblog/wp-admin/options-general.php?settings-updated=true

When I switch out the wp_get_referrer() function with the variable $parent_page then the redirect worked as expected.

I'm uncertain about leaving it like this as my change may have introduced issues elsewhere...

This issue is discussed at http://wordpress.org/support/topic/recuring-404-file-or-directory-not-found-error?replies=8#post-2527566

Attachments (1)

phpinfo.pdf (112.5 KB) - added by kwgagel 2 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Ipstenu2 years ago

  • Keywords close added

If anything, this would be an issue with BuddyPress (and should be pitched over there). Post about this on buddypress.org first, you'll find more BP-ians.

comment:2 scribu2 years ago

  • Keywords dev-feedback has-patch removed

comment:3 kwgagel2 years ago

OK, thanks. I've opened a ticket there...
http://buddypress.trac.wordpress.org/ticket/3892

comment:4 dd322 years ago

The buddypress ticket has been closed as invalid as being a core issue, The linked forum thread claims it's not a core issue.

What file/line number are you altering to correct this? Is it a specific combination of Multisite/BuddyPress, or can you duplicate it on plain MultiSite?
You seem to indicate that wp_get_referer() is returning an absolute path that doesn't work.. What's the path you're seeing? What's the path you expect to see?

comment:5 kwgagel2 years ago

Thanks for looking into this more.
This is a multisite/buddypress combo, I don't have a second multisite only to test with right now.

The path that gets returned is: userblog/wp-admin/userblog/wp-admin/options-general.php?settings-updated=true

The path that should be returned is: userblog/wp-admin/options-general.php?settings-updated=true

When you removed the extra userblog/wp-admin from the url and press enter it works.

Version 0, edited 2 years ago by kwgagel (next)

comment:6 Ipstenu2 years ago

/wp-admin/links.php is a 404 on my site.

However wp-admin/link-add.php (which is the real URL) is fine and I can add links all day long on WordPress 3.3 Multisite with subfolders and subdomains.

On Linux/Apache, mind, I don't have an IIS box.

comment:7 dd322 years ago

Ignoring the screenshot in the ticket, as it's for a non-existent file, I'm pretty sure I know the bug in question here.

It's not a Multisite or BuddyPress issue, rather it's a Path issue, the $_SERVER global has incorrect/invalid data for the current-file/referer fields. It's a configuration which I've not yet attempted to reproduce, but I'm pretty sure it's been mentioned before.

Would it be possible to get a var_dump($_SERVER); from the site (one where the referer field is filled in would be appreciated)? the output from phpinfo(); might also help

Similar issues exist for varying paths: #18768 and #10447 - neither are duplicates though.

kwgagel2 years ago

comment:8 kwgagel2 years ago

OK, I've uploaded a pdf showing the results of the information requested.

comment:9 kwgagel2 years ago

  • Keywords dev-feedback added; close removed

comment:10 jeremyfelt3 months ago

  • Keywords reporter-feedback added
  • Priority changed from normal to low

From comment 5:

  • The path that gets returned is: userblog/wp-admin/userblog/wp-admin/options-general.php?settings-updated=true
  • The path that should be returned is: userblog/wp-admin/options-general.php?settings-updated=true

From the attached report:

  • $SERVER['HTTP_REFERER'] = http://blogs.cnc.bc.ca/gagel/wp-admin/options-general.php
  • $REQUEST['_wp_http_referer'] = /gagel/wp-admin/options-general.php
  • $SERVER['REQUEST_URI'] = /gagel/wp-admin/options.php
  • PHP 5.3.8, Windows Server 2008 RC2, IIS 7.5

At the top of the report, it's implied that wp_get_referer() returned /gagel/wp-admin/options-general.php?settings-updated=true, though context is a little unclear.

It's possible that @dd32 may be able to grab something of value from the report.

If this could still be reproduced, that would be helpful. It seems that the issue would likely require an IIS 7.5 setup with a PHP configuration as close to the one attached in this ticket.

@kwgagel - It looks like blogs.cnc.bc.ca is still being served up by IIS 7.5. Can this issue still be reproduced?

comment:11 kwgagel3 months ago

  • Keywords reporter-feedback removed

I have logged into my blog and went straight to Settings as pictured here:
http://blogs.cnc.bc.ca/gagel/files/2014/01/WordpressPreError.png
Next I clicked Save and got this:
http://blogs.cnc.bc.ca/gagel/files/2014/01/WordPressError.png

So, the error is reproducible...

The has been updated (whenever available) and is now running "WordPress 3.8 running BuddyPress Default theme." The BuddyPress version is "You have version 1.8.1 installed" (which needs to be updated).

comment:12 jeremyfelt3 months ago

  • Component changed from Multisite to Permalinks
  • Focuses multisite added
Note: See TracTickets for help on using tickets.