Make WordPress Core

Changeset 1663


Ignore:
Timestamp:
09/15/2004 08:16:58 AM (20 years ago)
Author:
rboren
Message:

Make $pagenow work with PATH_INFO.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/vars.php

    r1438 r1663  
    3838    'ž' => '',
    3939    'Ÿ' => 'Ÿ'
    40 );
     40    );
    4141
    4242// On which page are we ?
    4343$PHP_SELF = $_SERVER['PHP_SELF'];
    44 $pagenow = explode('/', $PHP_SELF);
    45 $pagenow = trim($pagenow[(sizeof($pagenow)-1)]);
    46 $pagenow = explode('?', $pagenow);
    47 $pagenow = $pagenow[0];
    48 if (($querystring_start == '/') && ($pagenow != 'post.php')) {
    49     $pagenow = get_settings('siteurl') . '/' . get_settings('blogfilename');
     44if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) {
     45    $pagenow = $self_matches[1];
     46} else {
     47    $pagenow = explode('/', $PHP_SELF);
     48    $pagenow = trim($pagenow[(sizeof($pagenow)-1)]);
     49    $pagenow = explode('?', $pagenow);
     50    $pagenow = $pagenow[0];
     51    if (($querystring_start == '/') && ($pagenow != 'post.php')) {
     52        $pagenow = get_settings('siteurl') . '/' . get_settings('blogfilename');
     53    }
    5054}
    5155
Note: See TracChangeset for help on using the changeset viewer.