1 (edited by 2013-09-18 03:03:08)

Topic: Editor escapes html into scrambled mess

Here's my problem:  I enter news item using either the CKeditor or the original.  I add a table, then insert an image into the table.  It looks OK, until I preview it or re-open the news item and the html gets scrambled with all the quotes escaped with slashes.

Original html:

<table align="left" border="0" cellpadding="1" cellspacing="1" style="width: 250px;">
    <tbody>
        <tr>
            <td><img alt="" src="http://www.mysite.com/cnews/uploads/37660_175.jpg" style="width: 250px; height: 250px;" /></td>
        </tr>
        <tr>
            <td>This is my picture</td>
        </tr>
    </tbody>
</table>

and this is the html after preview or reopening:

<table align="\"left\"" alt="\"\"" border="\"0\"" cellpadding="\"1\"" cellspacing="\"1\"" height:="" img="" src="\" style="\"width:">
    <tbody>
        <tr>
            <td>This is my picture</td>
        </tr>
    </tbody>
</table>

and if I use quotes in the news item, I can end up with //////" in the display

I am using Firefox 23.1, my server is using linux running PHP 5.2.10 and my host will be upgrading me to 5.5 soon. I am using  CuteNews 2.0, however I tried dropping back to 1.5.3 and I got the same results.

Any assistance would be appreciated, I have looked through your forums, but I seem to be the only one to have had this problem.

-Thanks

Re: Editor escapes html into scrambled mess

Check if your server turn on magic quotes gpc (see http://php.net/manual/en/security.magicquotes.php)

Best regards,
CN Support team

Re: Editor escapes html into scrambled mess

Hi,
I really spent a lot of time researching this so I wouldn't waste your time.

The link you suggested is a 404, but I did locate the info on the php site. http://php.net/manual/en/security.magic … abling.php

By running <?php phpinfo() ?> I was able to determine magic quotes are on.  I added a php.ini to the cnews folder, and the core/modules folder with the command:  magic_quotes_gpc = Off

The html still came up escaped.  I installed cnews on another server, and had the same problem, until I CHMOD the conf.php to 777.  Then I was able to select the CKeditor, and everything worked.  I could not replicate this on the server I want to run it on, because conf.php was created by the installer, and the server identifies the owner as "nobody" and I can only CHMOD files I own.  I downloaded the installed cnews, deleted from the server using the CP file manager, re-uploaded so I am the owner, and successfully changed the permission to 777.

And after all this, when I select the CKeditor from the dashboard configure, the setting still does not stick, once I leave the page, the CKeditor option box becomes unchecked.

I found this post on your site that sounds like my problem, https://cutephp.com/forum/index.php?showtopic=43496 That was version 1.5.3, I'm using version 2, but I tried 1.5.3 and it behaves the same as I explained.

Once again, I thank you for your time in this matter.

Re: Editor escapes html into scrambled mess

Bug was fixed for 2.0 version ( there, github commit https://github.com/CuteNews/cutenews-2.0/co...2d4987da6087708 )

For older version сontact your hosting provider to disable magic_quotes_gpc (=off).

Best regards,
CN Support team

5 (edited by 2013-09-20 10:28:39)

Re: Editor escapes html into scrambled mess

Thank you very much, that seems to have done the trick.