TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 05, 2024, 09:19:57 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,178
  • Total Topics: 21,220
  • Online today: 93
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 47
  • Total: 47

"&undefined;" errors in HTML articles

Started by Jerri Blank, September 10, 2006, 03:51:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jerri Blank

I have an HTML article I created under 0.8.6, but under 0.9.5, all the apostrophes have been replaced with "&undefined;" .  Am I now going to have to escape apostrophes like you do in PHP code?

UPDATE: Escaping the apostrophes doesn't work.  Suggestions?

Thanks,

jb

IchBin

I can't remember what the work around for that is. But you can turn the editor off I think and that might work.

Jerri Blank

Thanks.  Do you know how to turn the editor off?



jb

IchBin



WhispyTuft

Not sure if this will work for you, but here goes ...

/Themes/default/TPortalAdmin.template.php find:

// tinyMCE
if($context['TPortal']['use_wysiwyg']=='1' && $mg['useintro']!=-1){
echo '
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "exact",
entity_encoding : "raw",
language : "en",
elements : "tp_article_body'.$mg['id'].'",
theme : "advanced",
plugins : "table,advhr,advlink,emotions,insertdatetime,preview,zoom,flash,searchreplace,contextmenu,ibrowser",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,flash,advhr,separator,print,ibrowser",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
convert_urls : false,
relative_urls : false,
plugin_insertdate_dateFormat : "%Y-%m-%d",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>';
}



Replace with:

// tinyMCE
if($context['TPortal']['use_wysiwyg']=='1' && $mg['useintro']!=-1){
echo '
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "exact",
elements : "tp_article_body'.$mg['id'].'",
theme : "advanced",
plugins :  "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>';
}



The only things removed were:

entity_encoding : "raw",
language : "en",
convert_urls : false,
relative_urls : false,



This may not be right or proper, I am not sure. On the other hand, removing these has made it so that the apostrophes are actually apostrophes instead of &undefined; . To get the apostrophe to work, it may not require removing all four of these settings, but these are the ones I removed.

If any of this is wrong or could pose a security risk, please don't hesitate to inform me :)

Jerri Blank

Thanks.  Using a different wysiwyg editor actually took care of the problem, but I'm sure your solution would work as well.  I think this is a bug, because it didn't start happening until TP was update recently.

reddogfantoo

Quote from: WhispyTuft on September 20, 2006, 03:27:37 PM
The only things removed were:

entity_encoding : "raw",
language : "en",
convert_urls : false,
relative_urls : false,


I was able to get the same result by only removing the following:


entity_encoding : "raw",


djpushplay

Quote from: Jerri Blank on September 10, 2006, 03:51:18 PM
I have an HTML article I created under 0.8.6, but under 0.9.5, all the apostrophes have been replaced with "&undefined;" .  Am I now going to have to escape apostrophes like you do in PHP code?

UPDATE: Escaping the apostrophes doesn't work.  Suggestions?

Thanks,

jb

Just wanted to confirm that TP 0.9.6 still has this same problem. I removed the TinyMCE entity_encoding : "raw", as per a later post and that did the trick but not sure if this is the proper way. Does this have something to do with the UTF8 or ?

I also noticed 2 more places in "TPdladmin.template.php" where TinyMCE uses "raw" encoding. Not sure if those have to be removed as well.