Support

Home Forums Event Espresso Premium How to remove backslashes from event descriptions

How to remove backslashes from event descriptions

Posted: September 24, 2013 at 3:09 pm

Viewing 4 reply threads


Jim Schuyler

September 24, 2013 at 3:09 pm

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?


Dean

September 24, 2013 at 11:44 pm

Hi Jim,

Can you give me a link to an example? It is likely upgrading to .35 will resolve this but Id like to check it out on my local server.

There are no hooks/filters to do this to my knowledge. It is in the code to add and remove slashes.


Jim Schuyler

September 25, 2013 at 1:15 am

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}


Jim Schuyler

September 25, 2013 at 1:33 am

I see why they’re there. Can’t be avoided. I will solve my problem another way.


Dean

September 25, 2013 at 1:43 am

Thanks for that Jim,

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.

https://eventespresso.com/wiki/pre-release-channel-guide/

Viewing 4 reply threads

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.

Event Espresso