CodeIgniter Forums
Possible bug in anchor function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Possible bug in anchor function (/showthread.php?tid=23897)



Possible bug in anchor function - El Forum - 10-25-2009

[eluser]davidbehler[/eluser]
I just tried using the anchor function to create a link that performs a search using google, e.g.:
Code:
echo anchor('http://www.google.com/search?q="first search term"+term2', 'Search');

However, that does not work as the anchor function removes everything after "q=". If I remove the quotes, e.g.
Code:
echo anchor('http://www.google.com/search?q=+search+term+term2', 'Search');
it works just fine.

Anyone ran into this before?
I had a quick look at the anchor function but could not find anything that would cause this...


Possible bug in anchor function - El Forum - 10-25-2009

[eluser]imn.codeartist[/eluser]
that is not a bug actually if you check in your brower and do the view source actually its printing everything

Code:
<a href="http://www.google.com/search?q="first search term"+term2">Search</a>

href start " ending at q=" and once starting double quote matches ending double quote it skips rest


Possible bug in anchor function - El Forum - 10-26-2009

[eluser]davidbehler[/eluser]
Yeah, I figured that out myself.

I would expect the anchor function to use urlencode or whatever to avoid such behaviour...