• I have a working widget in my site that contains a PHP includes statement. It has been a saved working widget for months but today, I added a line break in the text and now I can’t save the widget because I get a message that says special characters [ < ] need to be escaped, and both the < and the > are underlined in red. If I escape them, the PHP won’t work. This is new under WordPress 4.9.4. It was working in WordPress 4.9.2. Why is the Custom HTML widget now looking at them as special characters? How can this be fixed?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    PHP is not allowed in the custom HTML widget. Allowing PHP is a major security/reliability issue. What are you trying to accomplish?

    Thread Starter sleeplessindc

    (@sleeplessindc)

    @sterndata This is the code I have in the widget that used to work:

    This website is hosted by <a href="https://www.siteground.com/" rel="nofollow">SiteGround</a>. <i>Send comments about any problems with the <em><strong>functional performance</strong></em> of this website</i> using the <a href="https://accessible-techcomm.org/contact-us/"><strong>Contact Us</strong></a> form or send feedback to <?php
        include './wp-content/themes/aaron-child/includes/current_webdiva_email.php';
    ?>.
    • This reply was modified 6 years, 9 months ago by sleeplessindc. Reason: deleted clsing div
    • This reply was modified 6 years, 9 months ago by sleeplessindc.
    Thread Starter sleeplessindc

    (@sleeplessindc)

    @judgerookie Thank you but no, those only apply to greater than and less than symbols in HTML code to convert them to HTML code. I am talking about the symbols that are part of the PHP opening <?php and closing ?> tags. They cannot be converted to HTML code or the PHP statement will not work. Up until today, the PHP statement worked.

    In my case, the symbols around the anchor tag triggered the same error. (No PHP involved.) I got around it by clearing out the custom HTML widget, typing my code in another HTML editor, and then pasting all the code back into the widget and saving. The error doesn’t trigger again unless I try to edit inside the custom HTML widget.

    I experienced the exact same problem with the Custom HTML widget and resolved it simply by installing/activating one of the standard PHP Code Widget plugins…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom HTML widget thinks the angles in are special characters’ is closed to new replies.