Welcome Guest, Not a member yet? Register   Sign In
WYSIWYG Editor Not Interpreting Correctly CodeIgniter 3

We are in the process of upgrading our website from CodeIgniter 2 to CodeIgniter 3.  (3.1.9)

We have a WYSIWYG editor for editing website pages on the back-end of the site, which pulls html code from a database table and should display it in the editor.  

When the html code from the database displays in what should be WYSIWYG format, it is currently displaying with the html tags so that it looks something like this:
<p><b>Coming Soon!</p></b>
Instead of Coming Soon!

When the display is changed to show the html (via use of a toggle button), it will display as:
&lt;p&gt;&lt;b&gt;Coming Soon!   [etc.]
Instead of <p><b>Coming Soon!</p></b>

Since it is working correctly in CodeIgniter 2, it seems to be an issue with how CodeIgniter is interpreting the information coming from the database.

The code for retrieving and displaying the data is:
PHP Code:
$data    = array('name'=>'content''class'=>'redactor''value'=>set_value('content'htmlentities($content)), 'data-bv-excluded'=>'false');

What would we need to change in order to get the code to display correctly?

You need to turn off html_escape.
PHP Code:

Thank you - that worked for showing the WYSIWYG text.

However, the style keeps getting erased for images, so that they are not being aligned properly.

For example, in the html of the editor, instead of:
<img style="float: left; margin: 0px 20px 10px 0px; max-width: 95%; border: 6px double rgb(84, 85, 101); width: 401px; height: 601px;" src="//www.mywebsite.com/uploads/wysiwyg/About-Us.jpg" alt="My Website" height="300">

The following is showing:
<img xss="removed" src="//www.mywebsite.com/uploads/wysiwyg/About-Us.jpg" alt="My Website" height="300" style="">

Theme © iAndrew 2016 - Forum software by © MyBB