2

I'm using the latest version of WP. I have a problem, where clicking the logout button from the admin panel redirects to a completely broken link:

http://wp-login.php/?loggedout=true

As you can see, the domain is completely omitted from the link(in my case it's wp.localhost)

I will mention that this local WP site was "cloned" from a remote server, but i made sure to change the "siteurl" and "home" fields in the wp_options table, and everything else works just fine

Can somebody tell me, where the problem might be? Is there any other configuration field, that might be relevant to this?

  • Have you tried deactivating all plugins and/or switching to a default theme? Have you checked the wp-config.php file for special settings like WP_SITEURL? How about your .htaccess file - anything that's suspicious? – Sally CJ Sep 12 '19 at 13:12
  • When you cloned the site, did you use a database migration plugin? Just changing those two options in the database isn't usually enough. – WebElaine Sep 12 '19 at 14:09
  • Sally CJ: Deactivating plugins and switching to the default theme didn't help. Also i didn't see anything suspicious in .htaccess or wp-config.php. WebElaine: I didn't use migration tool. I just exported and imported my WP database. I think i also changed something besides those two options, but i don't remember what. Any ideas? – i.brod Sep 12 '19 at 22:26
  • "clicking the logout button" - right-click on the button/link and inspect the HTML - does it point to the proper URL? If yes, which button exactly is that (screenshot will help)? – Sally CJ Sep 13 '19 at 0:54
  • It's pointing to "wp.localhost/wp-login.php?action=logout..." I think the problem is in the redirecting that occurs AFTER the logout operation was successful, because clicking this link DOES invalidate the session, and i need to login again. I tried to follow the execution stack using XDEBUG, but didn't manage to pick up any clues... – i.brod Sep 13 '19 at 11:01
2

Found the answer. It is a bug in WordPress v5.2.3 affecting WordPress in Windows environments. Caused by backslashes in Windows paths that aren't stripped correctly

Details here: https://core.trac.wordpress.org/ticket/47980

I have tried the patch suggested and can confirm it solves the problem.

replace:

$location = '/' . ltrim( $path . '/', '/' ) . $location;

with

$location = '/' . ltrim( $path . '/', '/\\' ) . $location;

in /wp-includes/pluggable.php, line 1404

It says it will be fixed in version 5.2.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.