Slashes added when saving from frontend

This topic contains 5 reply and 2 voices, and was last updated by Tareq Hasan 10 years, 9 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
June 17, 2013 at 6:06 pm 4955
Tareq Hasan WP: 3.5.1 Frontend: 1.2 ----------------------- Hi I havve WP User Frontend enabled but when a user modifies and saves their post from the frontend, some slashes get added each time it gets saved. So what is originally this...
The man said "Hi, I am a test post which has been added by the frontend". It's great!
Becomes
The man said \"Hi, I am a test post which has been added by the frontend\". It\'s great!
How do I remove the slashes and stop them being added and saved please?
June 17, 2013 at 8:31 pm 4967
Tareq Hasan Tareq Hasan

It’s because of the user level. Some users like author, editor have unfiltered_html capability and which allow them to post without any sanitization/checking.

For the users like contributor, subscriber, WordPress filters those submission and as a security measure, they add slashes..

June 17, 2013 at 9:14 pm 4971
codynew codynew

Thanks, does this mean that I could use a plugin like User Role Editor to enable the unfiltered_html.

Would it actually be safe for me to do so?

What do you recommend?

June 18, 2013 at 11:35 am 4992
Tareq Hasan Tareq Hasan

Yes, you could use role editor plugin for that.

Never trust the user

So just don’t take my word. But I suppose you can give the permission.

June 18, 2013 at 2:48 pm 4996
codynew codynew

Thanks, just what IS unfiltered_html?

I don’t really want to expose myself on the website but at the same time, the slashes arent exactly acceptable 🙁

June 19, 2013 at 5:19 am 5028
Tareq Hasan Tareq Hasan

It’s a capability that will enable you to post texts without filtering.

As an example, the quote symbol has something to do with SQL injection and it’ll be escaped by adding a forward slash before it. If you have the unfiltered_html capability, it’ll not be escaped as you are marked as a trusted user.

Viewing 5 Posts - 1 through 5 (of 5 total)