+ get_blacklisted_tags();
$blacklisted_attributes = $this->get_blacklisted_attributes();
$blacklisted_protocols = $this->get_blacklisted_protocols();
diff --git a/includes/utils/class-amp-dom-utils.php b/includes/utils/class-amp-dom-utils.php
index 9492dd4cee5..8ffd3653e2c 100644
--- a/includes/utils/class-amp-dom-utils.php
+++ b/includes/utils/class-amp-dom-utils.php
@@ -160,23 +160,15 @@ public static function get_content_from_dom_node( $dom, $node ) {
*/
static $self_closing_tags_regex;
- /*
- * Most AMP elements need closing tags. To force them, we cannot use
- * saveHTML (node support is 5.3+) and LIBXML_NOEMPTYTAG results in
- * issues with self-closing tags like `br` and `hr`. So, we're manually
- * forcing closing tags.
- */
- self::recursive_force_closing_tags( $dom, $node );
-
/*
* Cache this regex so we don't have to recreate it every call.
*/
if ( ! isset( $self_closing_tags_regex ) ) {
$self_closing_tags = implode( '|', self::$self_closing_tags );
- $self_closing_tags_regex = "#>({$self_closing_tags})>#i";
+ $self_closing_tags_regex = "#({$self_closing_tags})>#i";
}
- $html = $dom->saveXML( $node );
+ $html = $dom->saveHTML( $node );
// Whitespace just causes unit tests to fail... so whitespace begone.
if ( '' === trim( $html ) ) {
@@ -189,10 +181,9 @@ public static function get_content_from_dom_node( $dom, $node ) {
* Seems like LIBXML_NOEMPTYTAG was passed, but as you can see it was not.
* This does not happen in my (@mikeschinkel) local testing, btw.
*/
- $html = preg_replace( $self_closing_tags_regex, '/>', $html );
+ $html = preg_replace( $self_closing_tags_regex, '', $html );
return $html;
-
}
/**
@@ -268,12 +259,14 @@ public static function is_node_empty( $node ) {
* Forces HTML element closing tags given a DOMDocument and optional DOMElement
*
* @since 0.2
+ * @deprecated
*
* @param DOMDocument $dom Represents HTML document on which to force closing tags.
* @param DOMElement $node Represents HTML element to start closing tags on.
* If not passed, defaults to first child of body.
*/
public static function recursive_force_closing_tags( $dom, $node = null ) {
+ _deprecated_function( __METHOD__, '0.7' );
if ( is_null( $node ) ) {
$node = $dom->getElementsByTagName( 'body' )->item( 0 );
diff --git a/readme.md b/readme.md
index 98afc1c400e..f6219724678 100644
--- a/readme.md
+++ b/readme.md
@@ -10,7 +10,7 @@ Enable Accelerated Mobile Pages (AMP) on your WordPress site.
**Tested up to:** 4.9
**Stable tag:** 0.6.0
**License:** [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)
-**Requires PHP:** 5.2
+**Requires PHP:** 5.3
[![Build Status](https://travis-ci.org/Automattic/amp-wp.svg?branch=master)](https://travis-ci.org/Automattic/amp-wp) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com)
diff --git a/readme.txt b/readme.txt
index eaaeee8d0f2..0a50cb8ccaf 100644
--- a/readme.txt
+++ b/readme.txt
@@ -6,7 +6,7 @@ Tested up to: 4.9
Stable tag: 0.6.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
-Requires PHP: 5.2
+Requires PHP: 5.3
Enable Accelerated Mobile Pages (AMP) on your WordPress site.
diff --git a/tests/amp-tag-and-attribute-sanitizer-private-methods-tests.php b/tests/amp-tag-and-attribute-sanitizer-private-methods-tests.php
index 1b9df941109..66b133c8c1e 100644
--- a/tests/amp-tag-and-attribute-sanitizer-private-methods-tests.php
+++ b/tests/amp-tag-and-attribute-sanitizer-private-methods-tests.php
@@ -619,10 +619,10 @@ public function get_remove_node_data() {
),
'remove_bad_tag_leave_empty_siblings_and_parent' => array(
array(
- 'source' => '