php.net |  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: -
Votes:1
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
Description:
------------
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:
---------------
<?php
function url_footobar($original, $rewritten) {
    return str_replace('foo', 'bar', $rewritten);
}
url_rewriter_callback('url_footobar()');
?>
<a href="http://foo.com/foo.php">foo</a>

Expected result:
----------------
<a href="http://bar.com/bar.php">foo</a>


Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 09:01:27 2024 UTC