|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #73221 Callback for PHP URL rewriter
Submitted: 2016-10-01 20:10 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: josh dot kelly27 at outlook dot com Assigned:
Status: Open Package: Unknown/Other Function
PHP Version: 7.1.0RC3 OS: Ubuntu 16.04.1LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: josh dot kelly27 at outlook dot com
New email:
PHP Version: OS:


 [2016-10-01 20:10 UTC] josh dot kelly27 at outlook dot com
Hi there,
I need to use PHP's URL rewriter for sessions with a built-in web client that cannot support cookies but also has 'special' HREF attributes on certain tags, such as href="*title".

While I admit that this is certainly quite an edge case, I could certainly see many uses for a callback for the PHP URL rewriter function (passes original URL and what PHP would rewrite the URL to, function returns new URL to replace the original), for validation and such :-)

Test script:
function url_footobar($original, $rewritten) {
    return str_replace('foo', 'bar', $rewritten);
<a href="">foo</a>

Expected result:
<a href="">foo</a>


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 17:01:29 2024 UTC