php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38843 output_add_rewrite_var failed on Url address beggining with http://
Submitted: 2006-09-15 12:36 UTC Modified: 2007-01-20 22:52 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: adrosetint at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.1.6 OS: Windows
Private report: No CVE-ID: None
 [2006-09-15 12:36 UTC] adrosetint at hotmail dot com
Description:
------------
function.output_add_rewrite_var fails with explicit URLs, i.e. URL's that explicilty include domain. But works with Implicit domains... e.g. those that do not contain the domain, but is implied to be the current domain. 

I realise the benefits, it doesn't alter the links to external domains, however could this function not realise if the URL is of the current domain, + where URLs are explicitly writen.

I've included two urls, the first type ( implicit ) works :) the second type ( explicit ) fails.

Is this a bug or a feature?

Reproduce code:
---------------
<?php 
 
output_add_rewrite_var('auth', '412e11'); 
 
?> 
<a href="link.php">Click Here</a>
<a href="http://this.site.net/link.php">Click Here</a>


Expected result:
----------------
<a href="link.php?auth=412e11">Click Here</a>
<a href="http://this.site.net/link.php?auth=412e11">Click Here</a>


Actual result:
--------------
<a href="link.php?auth=412e11">Click Here</a>
<a href="http://this.site.net/link.php">Click Here</a>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-15 12:50 UTC] tony2001@php.net
Reclassified as docu problem.
URL-Rewriter does not change absolute URLs intentionally.
 [2006-11-30 20:02 UTC] aldertb at xs4all dot nl
First, captcha's aren't working when cookies disabled (developping setting :P)

But what if someone posts in your forum, here look this product: http://mywebshop.tld/lawn-mower-p-89.html and someone clicks it while having cookies disabled, he will lose his cart and/or is login...

We can also strip the domain name including http:// (http://webshop.tld), and make it a relative url...

After that the buffer_rewrite will include a sessionid.

Btw, php 4.3.9. does a check if the var isn't set already while 5.0.4. (my local xampp version) doesn't. This was a lill' confusing. I will mention this in the online manual...

Best regards,
Aldert Berends

The Netherlands
 [2007-01-20 22:52 UTC] nlopess@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:10 UTC] phpdocbot@php.net
Automatic comment on behalf of nlopess
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=2975bda7b84becce49e270dc1b26c1d82f0e840b
Log: fix #38843: absolute urls not rewritten
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 08 22:01:31 2025 UTC