Problem with a code...
 
Notifications
Clear all

wpForo 1.x.x [Solved] Problem with a code in the post when editing

6 Posts
2 Users
4 Reactions
1,013 Views
Posts: 7
Topic starter
(@czaban)
Active Member
Joined: 3 years ago

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

 

Topic Tags
5 Replies
Chris
Posts: 3650
(@chris)
Famed Member
Joined: 3 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.

Chris
Posts: 3650
(@chris)
Famed Member
Joined: 3 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: 3 years ago

Active Member
Posts: 7

@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

 

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3650

@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: 3 years ago

Active Member
Posts: 7

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

My bests!