Nasty little bug - easy fix |
File: system/core/Config.php Line: 269
- $uri .= $suffix; + if (trim($uri) !== '') $uri .= $suffix; If $config['url_suffix'] is set to a value like $config['url_suffix'] = '.html' the home link will be generated as http://www.mydomain.com/.html The fix obove is solving the problem, however I hate to change the code in core, forcing me to keep track and check on the next release.
When having a suffix set in the config will not add the suffix when calling
PHP Code: site_url(); // Result http://www.yourdomain.com It will add the suffix when passing an URI argument to this method PHP Code: site_url('some-kind-of-page'); // Result http://www.yourdomain.com/some-kind-of-page.html But when the argument is ?test=1234 PHP Code: site_url('?test=1234'); // Result http://www.yourdomain.com/.html?test=1234 But to fix this, you don't need to edit the core. You can override the site_url method by adding it to a MY_url_helper file. EDIT: I have added a site_url method to a MY_url_helper. It sets the correct URL when only passing an query string PHP Code: /**
(11-07-2015, 08:41 AM)Martin7483 Wrote: When having a suffix set in the config will not add the suffix when calling As a matter of fact Code: site_url(' '); // Result http://www.yourdomain.com/ .html
I have updated the site_url method of MY_url_helper
PHP Code: /** |
Welcome Guest, Not a member yet? Register Sign In |