Hi all,
thanks again for reading my hideously irritating posts, which are usually solved very quickly followed by me shouting "d'oh".
So, at the moment I am assisting someone with a joomla front end modification(because we all known that joomla is awesome, but its front end is hideous) and a part of this is building articles from an RSS feed. Basically a script will grab the file contents and perform a variety of operations on them to populate the table.
However one problem i keep running into is when creating the alias. The alias is basically the text proceeding the id of the article.
I.e.
example.com/news/14-[B]boobs-are-everywhere[/B]/
Now, I am using the title of the article to create the alias which can look anything like this:
On the 5th October we will be holding a gala event, dont forget 5/10/2010
to
Bob and daves extravaganza
A few str_replace will get rid of the obvious problems, for example replacing spaces with - and removing ,.() etc etc.
The problem, no matter what i do someone will find inventive ways of putting bad characters into the title and my patience is wearing thin. So I suppose the question is, instead of having a black list can I have a white list style system using regular expression?
I.e. remove all characters within $str that are not a-z or space?
Any help will be more than welcome.
Neil