Improperly escaping attributes – leading to errors
-
I noticed a slew of AMP errors on a client’s site this morning. (Alerted by Search Console). The sidebar had invalid values for attributes. When I looked at the source code in the browser I noticed double quotes around attributes in the sidebar (leading to the invalid values and errors). See screenshot:
https://www.dropbox.com/s/72kcqyr1zm5qprp/Screen%20Shot%202018-11-19%20at%2010.32.50%20AM.png?dl=0
So, I took a look at the plugin code in the sidebar.php file. On line 67 if I remove the attribute escape function, esc_attr, the issue goes away. I did not dig any further than that, but it seems like it’s being fed double quote in that data array. Or there are some other escaping issues going on.
Note: I am using the amp theme framework as well.
The topic ‘Improperly escaping attributes – leading to errors’ is closed to new replies.