[wp-trac] [WordPress Trac] #39497: Can't log out completely without closing my browser
WordPress Trac
noreply at wordpress.org
Tue Feb 14 18:30:49 UTC 2017
#39497: Can't log out completely without closing my browser
------------------------------------+------------------------
Reporter: davidmlentz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7.3
Component: Login and Registration | Version: 4.7
Severity: normal | Resolution:
Keywords: | Focuses: multisite
------------------------------------+------------------------
Comment (by birgire):
Here are few examples to understand how {{{wp_guess_url()}}} works for my
install:
Frontend:
{{{
example.tld
- $_SERVER['PHP_SELF'] : /wp/index.php
- $path : /wp
- $url : http://example.tld/wp
}}}
{{{
example.tld/site1/
- $_SERVER['PHP_SELF']: /wp/index.php
- $path : /wp
- $url : http://example.tld/wp
}}}
Backend:
{{{
example.tld/wp-admin/index.php
- $_SERVER['REQUEST_URI']: /wp-admin/index.php
- $path :
- $url : http://example.tld
}}}
{{{
example.tld/site1/wp-admin/index.php
- $_SERVER['REQUEST_URI']: /site1/wp-admin/index.php
- $path : /site1
- $url : http://example.tld/site1
}}}
This part of {{{wp_guess_url()}}} is of relevance here for constructing
the {{{$path}}} variable:
{{{
// The request is for the admin
if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false || strpos(
$_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false ) {
$path = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '',
$_SERVER['REQUEST_URI'] );
// The request is for a file in ABSPATH
} elseif ( $script_filename_dir . '/' == $abspath_fix ) {
// Strip off any file/query params in the path
$path = preg_replace( '#/[^/]*$#i', '', $_SERVER['PHP_SELF'] );
...
}}}
where in the end the url is constructed with:
{{{
$url = $schema . $_SERVER['HTTP_HOST'] . $path;
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39497#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list