From: greg at freephile dot com
Operating system: RH Linux 8.0
PHP version: 4.3.3
PHP Bug Type: HTTP related
Bug description: _SERVER['REQUEST_URI'] does not capture fragment

Description:
------------
When a URI includes a fragment, that fragment is not captured as part of
the $_SERVER['REQUEST_URI'] variable, so it is not possible to use
p_url() to get the fragment. As an example, the following request
will NOT have the fragment in the $_SERVER['REQUEST_URI'] variable:
[url]http://www.freephile.com/admin/test.php?foo=bar#fragment[/url]

Instead, the $_SERVER['REQUEST_URI'] is given as
'/admin/test.php?foo=bar'

I use PHP to process outgoing site links on [url]http://www.buzgate.org[/url], but
due to this problem, I cannot redirect to external URIs containing a
fragment. The workaround is to recode those URIs into two querystring
variables and then reconstruct the URI:
to=http://somewhere.com/somepage.html&fragment=named_anchor

$externalSiteURI = $_REQUEST['to'] . $_REQUEST['fragment'];

Reproduce code:
---------------
See
[url]http://www.freephile.com/admin/test.php?foo=bar#fragment[/url]

and
[url]http://buzgate.org/referral.php?to=http://www.sba.gov/library/pubs.html#success4[/url]
(this link may be fixed with a workaround by the time you get this
message)

Expected result:
----------------
$_SERVER['REQUEST_URI'] = '/admin/test.php?foo=bar#fragment'

Actual result:
--------------
$_SERVER['REQUEST_URI'] = '/admin/test.php?foo=bar'

--
Edit bug report at [url]http://bugs.php.net/?id=25804&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25804&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25804&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25804&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25804&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25804&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25804&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25804&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25804&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25804&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25804&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25804&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25804&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25804&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25804&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25804&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=25804&r=float[/url]