Welcome Guest, Not a member yet? Register   Sign In
url_title inconsistent behaviour when encoding '.''s
#1

[eluser]iancant[/eluser]
Hi,

Have noticed a bug around CI's url_title function.

Code:
url_title('Matthew Jones.'); //returns correctly 'Matthew-Jones' "." has been removed

however when I use:
Code:
url_title('Matthew.Jones'); //I am returned 'Matthew.Jones' still

Please can you advise if this is a known bug previously (I couldn't find anything here on the search feature) and if so, what the suggested workaround if, should one exist at present.

Many Thanks

Ian
#2

[eluser]Pascal Kriete[/eluser]
Hi Ian,

Welcome to the forums.

What you're seeing here is expected behavior. The url_title function will allow periods as long as they are not at the end of the string. If you're looking to get rid of them you'll need to "extend" the url helper and override the url_title function.

Make sense?




Theme © iAndrew 2016 - Forum software by © MyBB