#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
Bug Reports
Problem with a code...
 
Share:
Share
Tweet
Share
Notifications
Clear all

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

    Last Post
RSS

czaban
Posts: 6
 czaban
Topic starter
September 23, 2021 10:13 pm
(@czaban)
Active Member
Joined: 1 year 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

 

 1-entering-code.jpg
 2-published-code.jpg
 3-edited-code.jpg
 4-entering-code-aaa.jpg
 5-published-code-aaa.jpg
wpForo Version
1.9.9
WordPress Version
5.8.1
PHP Version
7.4.23
MySQL version
10.1.48-MariaDB-0ubuntu0.18.04.1
This topic was modified 9 months ago 8 times by czaban
Topic Tags
code
5 Replies
Chris
Posts: 1452
 Chris
Admin
September 24, 2021 10:57 am
(@chris)
Support Team
Joined: 12 months 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.png

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Chris
Posts: 1452
 Chris
Admin
September 24, 2021 11:12 am
(@chris)
Support Team
Joined: 12 months 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);

 

 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Mrright and czaban liked
3 Replies
czaban
 czaban
(@czaban)
Joined: 1 year ago

Active Member
Posts: 6
September 24, 2021 4:28 pm
Reply toChrisChris

@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.jpg
Chris
 Chris
Admin
(@chris)
Joined: 12 months ago

Support Team
Posts: 1452
September 25, 2021 9:17 am
Reply toczabanczaban
Chris

@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

 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

czaban
 czaban
(@czaban)
Joined: 1 year ago

Active Member
Posts: 6
September 26, 2021 8:16 pm
Reply toChrisChris
czaban
Chris

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

My bests!

Mrright and Chris liked
  All forum topics
  Previous Topic
Next Topic  
Related Topics
  • Code post issue
    3 months ago
  • Edit CODE posts
    9 months ago
Topic Tags:  code (10),

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages wpforo-advanced-attachments-128x128 wpforo-embeds-128x128 wpForo User Custom Fields addon wpForo – Blog Cross Posting addon wpForo Ads Manager wpForo – WooCommerce Memberships Integration wpForo Emoticons wpForo – Tenor GIFs Integration
View all Addons »

Recent Topics

  • Attachments not showing on forums posts after migration

    By Formicid, 3 hours ago

  • New Feature About Plugin Customization and Integration

    By z14165899, 14 hours ago

  • WordPress Email sending function wp_mail() doesn't work!

    By feassistant, 22 hours ago

  • Import users from IPBoard

    By jesusdlg, 1 day ago

  • Intruder signing in to wpforo without approval

    By plaurits, 2 days ago

  • How to make new user to get approve manually before creating post and profile.

    By Adhyansh21, 3 days ago

Topic Tags

  • css52
  • translation50
  • plugin conflict48
  • seo47
  • new features45
  • buddypress43
  • avatar41
  • moderation40
  • ultimate member40
  • login40
  • forum40
  • registration37
  • threaded layout35
  • cache34
  • spam33
  • editor33
  • menu33
  • shortcode32
  • forum accesses30
  • widget29
View all tags (2195)

Recent Posts

  • RE: replacing create_function() with something else for PHP8 [duplicate]

    Hi @douglajonson, what is the plugin name?

    By Chris, 1 hour ago

  • RE: Description for each topic?

    @christine, wpForo does not have a topic description ...

    By Chris, 2 hours ago

  • RE: About Plugin Customization and Integration

    Hi @z14165899, Please send your request to sales[at]g...

    By Chris, 2 hours ago

  • Attachments not showing on forums posts after migration

    Hello I just did a manual migration and the older forum...

    By Formicid, 3 hours ago

  • RE: WordPress Email sending function wp_mail() doesn't work!

    @dimalifragis thanks for the enlightenment there. It...

    By feassistant, 16 hours ago

  • RE: Intruder signing in to wpforo without approval

    Maybe at Wordpress.org ?

    By dimalifragis, 1 day ago

  • Import users from IPBoard

    Hello, Is it possible to import users from ipboard? (...

    By jesusdlg, 1 day ago

Share:
Share
Tweet
Share
  Forum Statistics
21 Forums
9,940 Topics
50.3 K Posts
13 Online
48.4 K Members

Latest Post: replacing create_function() with something else for PHP8 [duplicate] Our newest member: Snehasharma Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2022 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation