ericmckean / quirkysoft

Automatically exported from code.google.com/p/quirkysoft
GNU General Public License v3.0
0 stars 0 forks source link

Relative query links don't work #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to http://doodle77.dyndns.org/dstestcase/testcase.php
2. Click the link
3. End up at http://doodle77.dyndns.org/dstestcase/?a

What is the expected output? What do you see instead?
You should end up at http://doodle77.dyndns.org/dstestcase/testcase.php?a

Which version are you using?
0.7.6

Original issue reported on code.google.com by Doodle...@gmail.com on 20 Sep 2009 at 1:16

GoogleCodeExporter commented 9 years ago
Similary, Location: redirects don't work correctly either.
http://doodle77.dyndns.org/dstestcase/testcase2.php should redirect you to
http://doodle77.dyndns.org/dstestcase/testcase2.php?a

Original comment by Doodle...@gmail.com on 20 Sep 2009 at 1:22

GoogleCodeExporter commented 9 years ago
Patch should be this:
$ diff URI.cpp URI_patch.cpp
281a282,294
>   else if (newFile[0] == '?')
>   {
>     // internal link, add newFile to the existing address
>     size_t lastQuestionMark(tmp.m_address.rfind("?"));
>     if (lastQuestionMark == string::npos)
>     {
>       newURI = tmp.m_address + newFile;
>     }
>     else
>     {
>       newURI += tmp.m_address.substr(0,lastQuestionMark) + newFile;
>     }
>   }

Original comment by Doodle...@gmail.com on 20 Sep 2009 at 3:59

GoogleCodeExporter commented 9 years ago
actually patch should be this, so that it doesn't mess up linking from a.php#b 
to a.php?c
$ diff URI.cpp URI_patch.cpp
281a282,294
>   else if (newFile[0] == '?')
>   {
>     // internal link, add newFile to the existing address
>     size_t lastQuestionMark(tmp.m_address.rfind("?"));
>     if (lastQuestionMark == string::npos)
>     {
>       newURI = tmp.m_address.substr(0,tmp.m_address.rfind("#")) + newFile;
>     }
>     else
>     {
>       newURI += tmp.m_address.substr(0,lastQuestionMark) + newFile;
>     }
>   }

Original comment by Doodle...@gmail.com on 20 Sep 2009 at 2:40

GoogleCodeExporter commented 9 years ago
Thanks for the patch! Applied in r6838620cc1

Original comment by richard.quirk on 17 Oct 2009 at 5:43