EllisLab/CodeIgniter — pull request #999 by Dumk0 (2012-01-29 20:48:24+00:00)
Title: site_url() improvement

Fixed url suffix position in site_url() result string if argument $uri contains query string. In some cases it might be useful to have query string in uri (example: JavaScript URI parsers etc). But my problem is that I am using additionally url suffix (Ex. ".html") and in case of the following call: site_url('controller/method/argument?myvar=1&other=2') - i am getting "http://www.example.com/controller/method/argument?myvar=1&other=2.html which is wrong as you understand. So I decided to fix this issue. Please check my change.

Another thing I've found is that there was used $uri (if array) iteration for building query string. There is php function to do the same - http_build_query().