Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2008
    Location
    The Midwest
    Posts
    11
    Plugin Contributions
    0

    Default [Done v1.3.9a] HTML Entities and the Plain Text Editor for Define Pages and EZPages

    Working with Zen-Cart version 1.3.8a fresh installation or upgrade from 1.3.7.

    For the EZ-Pages editor as well as the define pages editor, I've found that if I type a URL that has entities such as "&" or "•" in it, I can type it in and save the changes and everything works great. However, when I go to edit that page in plain text, when I pull up the code, the entities appear as the characters themselves, such as "&" and "•", instead of "&" and "•". The result is that when you update your pages, you will eventually end up with a bunch of validation errors. Trust me, it will happen. Validation matters very much to me, and I hate the nuisance of find/replace every time I edit a page. Quite simply put, it's wrong.

    I've corrected the problem on my own installations of Zen-Cart by doing the following:

    Line 440 of /admin/ezpages.php, change "$ezInfo->pages_html_text" to htmlspecialchars($ezInfo->pages_html_text)

    Line 197 of /admin/define_pages_editor.php, add a line of code that says: $file_contents = htmlspecialchars($file_contents); I'm not sure why you can't just add it to the existing "zen_draw_textarea_field" function parameters, but it doesn't work that way for me. I had to run htmlspecialchars on the $file_contents variable before calling the function for whatever reason.

    I would recommend making these changes standard in any future releases of Zen-Cart. I would also recommend doing something similar for any other pages which employ the plain-text editor.

    Thanks,
    Ben
    grafcaps.com et. al.

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: HTML Entities and the Plain Text Editor for Define Pages and EZPages

    This is largely due to inadequacies in the HTMLArea editor.

    FCK and TinyMCE eliminate a lot of these sorts of problems.
    19 years a Zencart User

  3. #3
    Join Date
    Aug 2008
    Location
    The Midwest
    Posts
    11
    Plugin Contributions
    0

    Default Re: HTML Entities and the Plain Text Editor for Define Pages and EZPages

    Quote Originally Posted by schoolboy View Post
    This is largely due to inadequacies in the HTMLArea editor.

    FCK and TinyMCE eliminate a lot of these sorts of problems.
    If you read my post thoroughly, you'll realize that this has ABSOLUTELY NOTHING to do with HTMLarea, TinyMCE or FCKeditor or CKeditor or whatever you want to call it. This is specifically an issue dealing with the "Plain Text" HTML editor, which isn't really an HTML editor at all, but simply a textarea HTML element with the contents of the page in question dumped inside the text node.

    Now, the HTMLarea editor ALSO strips the HTML entities out of your code. It does some other interesting/questionable things too, such as rewriting your JavaScript and re-ordering the parameters in your HTML elements. However, I have failed to find a workaround for this issue in HTMLarea. If you would like to accomplish something beyond meaningless conjecture, schoolboy, you might want to look into a solution to this issue. Personally, I never use the WYSIWYG editors, so I couldn't care less.

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: HTML Entities and the Plain Text Editor for Define Pages and EZPages

    Nor could you care less about manners, apparently.

  5. #5
    Join Date
    Aug 2008
    Location
    The Midwest
    Posts
    11
    Plugin Contributions
    0

    Idea or Suggestion Re: HTML Entities and the Plain Text Editor for Define Pages and EZPages

    Quote Originally Posted by stevesh View Post
    Nor could you care less about manners, apparently.
    I don't see what manners have to do with the bug in question, nor do I see what one-line responses of any sort have to contribute to this discussion. If you actually write code and have something to add that will help to resolve the issue at hand, please share your thoughts. If all you're doing is opining on the quality of a particular editor or taking offense to my curt, yet appropriate response, Judith Martin style, perhaps you are liable to rebuke. Just a thought...

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: HTML Entities and the Plain Text Editor for Define Pages and EZPages

    Manners have everything to do with decorum in this, and other forums. schoolboy has been around here a while, and while he's good, he's not infallible. It's possible he didn't read your original post completely, or misunderstood your point.

    A decent human being would have replied to his post with something like, "I don't think you understood my post - [add further explanation here]". Compare that with your reply.

    Your response was anything but appropriate, and while I'm no Judith Martin, I know a lack of common courtesy when I see it.

  7. #7
    Join Date
    Aug 2008
    Location
    The Midwest
    Posts
    11
    Plugin Contributions
    0

    red flag Re: HTML Entities and the Plain Text Editor for Define Pages and EZPages

    Quote Originally Posted by stevesh View Post
    Manners have everything to do with decorum in this, and other forums. schoolboy has been around here a while, and while he's good, he's not infallible. It's possible he didn't read your original post completely, or misunderstood your point.

    A decent human being would have replied to his post with something like, "I don't think you understood my post - [add further explanation here]". Compare that with your reply.

    Your response was anything but appropriate, and while I'm no Judith Martin, I know a lack of common courtesy when I see it.
    In that case, many many apologies to you, stevesh, for the horrible disservice that you perceive schoolboy has suffered in your witness. Your eyes have suffered in the light of such injustice that it must be hard to carry on from day to day. Are you affected by PTSD? I'm sure that schoolboy will never recover from such a harsh verbal offensive, as evidenced by his apparent inability to respond (more likely complete apathy) with such bold conviction as you have. At any rate, thank you so much for your help. You've been most illuminating.

    Please share more of your thoughts on morality and other topical matters (particularly as they relate to my character) as soon as you have the chance. I can't wait to hear them. In the prestigious words of our generation's greatest voice, the esteemed Maddox: "nobody cares."

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: HTML Entities and the Plain Text Editor for Define Pages and EZPages

    You could have just said "I didn't mean to be offensive" or the like, and defused the situation. Replying to a (relatively mild) reprimand from a regular with a flame is not reasonable conduct in any forum.
    Some people do care about civil discourse.

    Meanwhile, your OP gives good insight into an annoying "feature" of the plaintext editor.
    Last edited by gjh42; 23 Feb 2010 at 01:25 AM.

 

 

Similar Threads

  1. Plain Text editor munging code in define pages editor
    By TecBrat in forum Customization from the Admin
    Replies: 2
    Last Post: 24 Feb 2013, 12:19 PM
  2. v150 No panel in define pages editor, and html dropdown option missing
    By moksha in forum General Questions
    Replies: 2
    Last Post: 8 Mar 2012, 12:26 AM
  3. Define Pages Editor has only text editor no more html
    By faynart in forum General Questions
    Replies: 4
    Last Post: 13 Dec 2011, 08:03 PM
  4. HTML Special Character and Plain Text Editor (1.3.8)
    By chadderuski in forum General Questions
    Replies: 2
    Last Post: 16 Aug 2011, 05:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR