Hi Paul, On 11/09/14 15:21, Paul Wise wrote: > On Thu, Sep 11, 2014 at 9:53 PM, Paul Wise wrote: > >> Thanks! Committed and made live: > > Daniel, there is one bug I'm hoping you can help with since I've > mostly forgotten how to write PHP. > > URLs like this: > > https://qa.debian.org/watch/sf.php/chromium-bsu > > Need to be redirected to URLs like this: > > https://qa.debian.org/watch/sf.php/chromium-bsu/ > > Otherwise the links within the page will go to the wrong place. > I've attached a patch which should solve this problem, in fact it was already in my script just not used as you'll see. I've tested the patch locally and it seems to function okay for URLs both with and without a trailing slash Any problems let me know Regards Daniel
Use the link which has been generated from the project and file name. This avoids complications with a URL having (or not having) a trailing slash. Index: sf.wml =================================================================== --- sf.wml (revision 3259) +++ sf.wml (working copy) @@ -36,7 +36,7 @@ foreach ($files as $item) { $file = basename($item->title); $link = $_SERVER['SCRIPT_NAME'] . "/$project/$file"; - echo "<a href='$file'>$file</a><br>\n"; + echo "<a href='$link'>$file</a><br>\n"; } ?> </p>
Attachment:
signature.asc
Description: OpenPGP digital signature