Bear with me here, this is long. I’m using EE 33 but have 35 available for testing. Our event descriptions frequently contain HTML. For instance we might have an “A” tag with an “HREF=” and that might contain a URL. Of course the HREF string is quoted and contains slashes. EE prefixes a backslash to quotes and slashes, presumably when saving to database in order to sidestep SQL injection attacks.
Later in viewing a calendar on screen we show those descriptions. Turns out that if we “view source” on a calendar page, we see that the backslashes are still in the HTML. Browsers remove backslashes from URLs, so this doesn’t affect human users. But bots and spiders do not, and this is an issue for us.
I am aware that the calendar is separate code, but I see backslashes in the code that EE is passing to the javascript calendar.
I want to “hook” in somewhere if possible and remove/filter those backslashes out before they go to the calendar. The reason is pretty twisted, but I have to get rid of them. Suggestions on where to look or hook?
http://stores.athleta.net/store-7041/ and do a “view source” and you will see backslashes inside the events. Look for the line AFTER “//Load the events into json srrsy” and you will see backslashes, especially in some URLs to external sites that appear within event descriptions. I have substituted curly brackets in this sample … {a href=\”http:\/\/www.lifetimefitness.com\/\”}www.LifeTimeFitness.com{\/a}
OK, well there isn’t much we can do about that in that version of the calendar. You might want to check out the latest Beta version of the calendar (2.1.1) in the pre-release section.
It has changed how data is imported, so instead of that big JSON dump in the view source, there isn’t anything there.
The support post ‘How to remove backslashes from event descriptions’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.