AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Solved] Problem with a code in the post when editing

6 Posts
2 Users
4 Reactions
3,119 Views
Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@czaban)
Active Member
Joined: 5 years ago
[#18770]

Hi Team,

I noticed a week ago a problem with a code embedded in the post. Parts of it disappears while trying to edit it

Example:

1. I'm adding to the post a code like

#include <sample.h>

2. Saving the post and it looks fine

3. Editing post and then I see a code like

#include

The part basically disappears 

Other examples:

1. Adding code like that

aaa::bbb:ccc

2. Saving post

I see

aaaccc

 

I thought it's a problem with wpForo - Syntax Highlighter plugin I bought while I turned it off and the same is with a plain version of code formatting.

I've cleaned a wpForo cache, turned off/on other plugins installed - with no success. 

I'm attaching screenshots to visualize the problem.

This is a very unfortunate problem as the code embedded loses parts of it and forum users who copy the code from the forum have lot's of problems as it's not complete.

 

EDIT: Actually it looks that this is a general problem with wpForo not mine only. I see in this post the same issue

Please just try to edit this post and see the red text in published and edit mode: aaa::bbb::ccc

 

1 entering code
2 published code
3 edited code
4 entering code aaa
5 published code aaa
wpForo Version
1.9.9
WordPress Version
5.8.1

Topic Tags
5 Replies
Chris
Posts: 3610
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@chris)
Famed Member
Joined: 5 years ago

Hi @czaban,

Please go to \wp-content\plugins\wpforo\wpf-includes\ open wpf-hooks.php, find 

$post['body'] = htmlspecialchars($post['body']);

this code will be comented by default, make it uncomented.

 2021 09 24 14 57 18

Chris
Posts: 3610
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@chris)
Famed Member
Joined: 5 years ago

@czaban,

also add this at the end of the line

, ENT_NOQUOTES);

 So the code will look like this

$post['body'] = htmlspecialchars($post['body'], ENT_NOQUOTES);

 

 


3 Replies
(@czaban)
Joined: 5 years ago

Active Member
Posts: 7
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@chris confirming, it solves the first case 2nd case is still problematic

please try the case in the attached screenshot

problem is after saving the post

 

 4 entering code aaa

Chris
(@chris)
Joined: 5 years ago

Famed Member
Posts: 3610
Chris
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@czaban,

Go to wp-content\plugins\wpforo\wpf-includes open function.php, find the below code

function wpforo_strip_shortcodes(

after that, make a comment, the code before the if

 


(@czaban)
Joined: 5 years ago

Active Member
Posts: 7
Chris
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@chris Thanks! Wanted to confirm that all work well. 

My bests!


Share: