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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Mon Nov 25 12:01:31 2024 UTC