Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Every time anyone edits a post, it converts all the HTML characters to htmlspecialchars and ruins the formatting
Avatar
Helping Outreach
Member
Free Members
sp_UserOfflineSmall Offline
Apr 12, 2017 - 12:45 pm

Has anyone ever seen this problem? Whenever a user edits an existing post, it suddenly gets saved in the database as the "htmlspecialchars" (or "htmlentities") version of itself. So, from now on, whenever the post is viewed, the HTML code becomes visible in the post.

For example, if the post is:

<p>Hello <strong>world</strong></p>

Then, after editing, it will be saved in the database as:

<p>Hello <strong>world</strong></p>

This only happens when editing an existing post. When creating one from scratch, the HTML code saves fine and the post appears correctly.
I have SimplePress 5.7.4 on WP 4.7.3, and I do use the TinyMCE plugin (also latest version, 3.3.4). The database itself uses charset utf8mb4_unicode_ci.

What is causing this? Any help appreciated.
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 12, 2017 - 3:37 pm

How very strange. And even stranger that it only happens on an edit and not a new post. And of course - it makes it harder to think of a reason it might be happening.

Let's start with the obvious. Do you have any WordPress plugins active that might be filtering the text prior to its saving. So - any that are used to add something to blog post creation? Anything added to the tinyMCE editor in the blog post arena - extra buttons/functionality?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 12, 2017 - 9:06 pm

does the post display correctly?

Avatar
Helping Outreach
Member
Free Members
sp_UserOfflineSmall Offline
Apr 13, 2017 - 12:19 pm

Mr. Papa: No, the post does not display correctly. Because it's being converted to htmlentities, when it displays, it actually shows the HTML code to the reader.

Yellow Swordfish: There is no extra TinyMCE functionality added.

BUT, I may have found a plugin which is causing it. Not sure. This is a preliminary suspicion. I recently updated the "Clean Login" plugin and it may be the culprit. I will report back. Thank you for the suggestions so far.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 13, 2017 - 12:32 pm

OK - please let us know what you find...

Are you aware - by the way - that you actually raised this question last June (https://simple-press.com/suppo.....ce-editor/) but never got back us after our initial reply...?

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 618
Members: 17357
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10123
Posts: 79616