Title: [Plugin: WordPress Processing Embed] Altcontent escaping bug
Last modified: August 20, 2016

---

# [Plugin: WordPress Processing Embed] Altcontent escaping bug

 *  [huyz](https://wordpress.org/support/users/huyz/)
 * (@huyz)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-processing-embed-altcontent-escaping-bug/)
 * In the file `wordpress_processing_embed.php`, in the code section that outputs
   the link for “newwindow”, `$altcontent` needs to be escaped with `htmlspecialchars(
   $altcontent, ENT_QUOTES)`.
    Otherwise, the altcontent won’t be able to contain
   single or double quotes.
 * [http://wordpress.org/extend/plugins/wordpress-processing-embed/](http://wordpress.org/extend/plugins/wordpress-processing-embed/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [huyz](https://wordpress.org/support/users/huyz/)
 * (@huyz)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-processing-embed-altcontent-escaping-bug/#post-2153693)
 * Need to escape newlines too.
    So `$altcontent_esc = htmlspecialchars(preg_replace('/\
   n/', '\\n', $altcontent), ENT_QUOTES);`
 *  Thread Starter [huyz](https://wordpress.org/support/users/huyz/)
 * (@huyz)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-processing-embed-altcontent-escaping-bug/#post-2153874)
 * Actually, in this case, the single quotes (and backslashes) need to be escaped
   with `\` for Javascript, not HTML.
    So
 *     ```
       $altcontent_esc = preg_replace('/([\'\\\\]|\n)/', '\\\\$1', $altcontent);
                   $altcontent_esc = htmlspecialchars($altcontent_esc);
       ```
   
 *  Thread Starter [huyz](https://wordpress.org/support/users/huyz/)
 * (@huyz)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-processing-embed-altcontent-escaping-bug/#post-2153877)
 * I have to note that, in the case of the “newwindow” method, it doesn’t make much
   sense to reuse `altcontent` for displaying both (a) as link text for popping 
   up the window and (b) as alternate text if Java is not installed.
 * Imagine if I chose altcontent “Pop up the applet”. This will make sense for the
   link, but then when the popup window comes up and I don’t have Java installed,
   it will repeat “Pop up the applet,” which doesn’t make sense in this context.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: WordPress Processing Embed] Altcontent escaping bug’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-processing-embed.svg)
 * [Wordpress Processing Embed](https://wordpress.org/plugins/wordpress-processing-embed/)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-processing-embed/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-processing-embed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-processing-embed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-processing-embed/reviews/)

 * 3 replies
 * 1 participant
 * Last reply from: [huyz](https://wordpress.org/support/users/huyz/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-processing-embed-altcontent-escaping-bug/#post-2153877)
 * Status: not resolved