We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Tiny MCE: Quotes in field data causing parse error in conditionals

Development and Programming

Luke Hardiman's avatar
Luke Hardiman
109 posts
16 years ago
Luke Hardiman's avatar Luke Hardiman

Hi, I have several fields running tiny mce (LG Tiny MCE) where clients will be able to paste in rich text or html content. The problem I’m having is when the wysiwyg data contains double and single quotes (and perhaps other entities as well) - my conditionals in the template are throwing a parse error:

Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/my-site/httpdocs/my-system-folder/core/core.functions.php(637) : eval()'d code on line 103

I have tried both of the following conditional formats with no joy:

{if field_name} and {if field_name != ""}

I’ve also tried php conditionals with addslashes and htmlentities but they still fail with the same eval error above.

I guess what I would like to know is,

  1. what is the most elegant way to test for the existence of a field that contains html
  2. more generally, is there a way to get EE to throw more meaningful php errors so that I can figure out where I’m going wrong on that front.

Thanks!

Move to Extensions forum by Moderator

       
Luke Hardiman's avatar
Luke Hardiman
109 posts
16 years ago
Luke Hardiman's avatar Luke Hardiman

I have done some testing and noticed that this problem does not occur when the same data is pasted into a vanilla EE textarea with formatting set to none. So the issue seems to be related to how LG Tiny MCE saves the user input to the database?

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

It sounds like it’s the issue. Moving to Extensions forum for additional community support.

       
Luke Hardiman's avatar
Luke Hardiman
109 posts
16 years ago
Luke Hardiman's avatar Luke Hardiman

Thanks Sue, I just posted here with a few more details prior to receiving your mail.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.