From b581c4fc1c979636b85be0026b5ec2d152fd0b54 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 25 Jan 2018 16:38:52 -0800 Subject: [PATCH] Prevent saveHTML from munging amp-mustache curly braces via URL-encoding --- includes/utils/class-amp-dom-utils.php | 56 ++++++++++++++++++++++ tests/test-tag-and-attribute-sanitizer.php | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/includes/utils/class-amp-dom-utils.php b/includes/utils/class-amp-dom-utils.php index cea51615da8..6d640d8e459 100644 --- a/includes/utils/class-amp-dom-utils.php +++ b/includes/utils/class-amp-dom-utils.php @@ -59,6 +59,22 @@ public static function get_dom( $document ) { // @todo In the future consider an AMP_DOMDocument subclass that does this automatically. See . $document = self::convert_amp_bind_attributes( $document ); + /* + * Prevent amp-mustache syntax from getting URL-encoded in attributes when saveHTML is done. + * While this is applying to the entire document, it only really matters inside of