Good afternoon, SW. Specialists. Please tell me what can cause the following problem with ckeditor :

 <p> <a href=\"http://ruslandscape.ru/images/pic1.jpg\">http://ruslandscape.ru/images/pic1.jpg</a></p> <p> <img alt=\"xczczcz\" src=\"http://ruslandscape.ru/images/pic1.jpg\" style=\"width: 308px; height: 257px; \" /></p> 

In general, the crux of the problem is that CKeditor inserts * * into links and images. And in this wrong form, the information gets into the database, and then to the site, where, as a result, the pictures are not displayed and the links do not work. The funny thing is that on my PC I managed to get this glitch somehow, by updating the ckeditor-а , but when I download the site to the server, this glitch still remains. I don’t know what to do, advise if anyone knows what could be the problem.

5 answers 5

And at you when value is brought in a DB, it is screened? mysql_real_escape_string that is.

  • Yes, this screening is used, I found it optimal. So it’s interesting that with its consideration, everything works on my Denver, but not on the Internet server. Actually because of this difference and my question arose, I think it is impossible to cancel this screen, even despite the fact that this method of introducing texts will be available only to the site administrator. So I'm looking for a workaround. Actually, this screen is used everywhere in me, that is, on my site several types of content are displayed, but slashes come out only in a block with the main text and images. Here I have a question why he blocks here. - anj1817
  • you never said whether magic_quotes_gpc is enabled on the host - Arseniy
  • No matter how silly the decision was, but when I ran into this problem I removed mysql_real_escape_string for the string being processed by ckeditor. Maybe she was already screened somewhere before, but I didn’t understand this, until the problem was added to the database, no matter what characters I used. - Shevsky

And what prevents to remove slashes?

 $str = stripslashes($str); /*Удаляем обратные слэши*/ 

    This editor always screens. On the Internet there is a lot of information to combat this. As a last resort, you can turn it off and fix it yourself (but it’s better to do it except for you, no one will use it for sure or will not try to do something exactly according to the book, imagining that you are a hacker))) You call the file fceditor-php5.php or something like this. Unfortunately not at hand, I am writing from the phone.

    • and a little more detail, I was already in this file today. I tried to edit it, but I didn’t see anything, thanks in advance. - anj1817

    Add a line to the php.ini file:

     magic_quotes_gpc=off 

      If I understand you correctly, is the output coming from your database? I usually do this

       $s=mysql_query("select * from table where text!=(либо <>)"" (либо is not null) "); $r=mysql_fetch_array($s); if ($s) { echo '<div>'.str_replace('\"', '"', $r["text"]).'</div>'; } 

      }