2012-04-14 3 views
2

In DB ist es das folgende.<und Zitat ändern zu HTML-Entitäten in tinyMCE

<img src="../../../../assets/images/frontpage/big_tree.jpg" alt="" 
width="516" height="200" /> 

Aber wenn es in TinyMCE ist, die ganze <,> und "change in HTML-Entitäten wie diese. So ist es nicht in FF angezeigt werden soll.

&lt;img src=&quot;../../../../assets/images/frontpage/big_tree.jpg&quot; 
alt=&quot;&quot; width=&quot;516&quot; height=&quot;200&quot; /&gt; 

Wie kann ich dieses Problem zu vermeiden ?

ich habe folgendes tinyMCE init

tinyMCE.init({ 
     mode : "textareas", 
     /* // if I want to add to a specific area then use this 
     mode : "specific_textareas", 
     editor_selector : "mceEditor", // add class="mceEditor" where you want to add tinyMCE 
     */ 

     theme : "advanced", 
     plugins : "advimage,advlink,media,contextmenu", 
     //theme_advanced_buttons1_add_before : "newdocument,separator", 
     theme_advanced_buttons1_add : "fontselect,fontsizeselect", 
     theme_advanced_buttons2_add : "separator,forecolor,backcolor,liststyle", 
     theme_advanced_buttons2_add_before: "cut,copy,separator,", 
     theme_advanced_buttons3_add_before : "", 
     theme_advanced_buttons3_add : "media", 
     theme_advanced_toolbar_location : "top", 
     theme_advanced_toolbar_align : "left", 
     theme_advanced_statusbar_location : "bottom", 
     //extended_valid_elements : "hr[class|width|size|noshade]", 
     extended_valid_elements : "span[class|align|style]", 
     file_browser_callback : "ajaxfilemanager", 
     paste_use_dialog : false, 
     theme_advanced_resizing : true, 
     theme_advanced_resize_horizontal : true, 
     apply_source_formatting : true, 
     force_br_newlines : true, 
     force_p_newlines : false, 
     relative_urls : true 
    }); 

Vielen Dank im Voraus.

Antwort

2

Sie müssen den Inhalt von tinymce in der Datenbank speichern ("<" und ">" als echte Zeichen) oder Sie müssen den Datenbankinhalt entschlüsseln, bevor Sie ihn in die Webseite rendern. Abhängig von Ihrer Skriptsprache (Perl, PHP, Python, ...) gibt es dafür spezielle Funktionen.

0

Ich hatte gleiche Problem korrigierte ich sie durch Zugabe von

 $_POST = array_map('stripslashes', $_POST);