Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store validation errors in order of occurrence in document #1335

Merged
merged 1 commit into from
Aug 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function sanitize() {
while ( ! empty( $this->stack ) ) {

// Get the next node to process.
$node = array_pop( $this->stack );
$node = array_shift( $this->stack );

/**
* Process this node.
Expand Down
2 changes: 1 addition & 1 deletion tests/test-class-amp-theme-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -1524,8 +1524,8 @@ public function test_prepare_response() {
'<script type="text/javascript" src="https://cdn.ampproject.org/v0/amp-mathml-latest.js" async custom-element="amp-mathml"></script>',

// Note these are single-quoted because they are injected after the DOM has been re-serialized, so the type and src attributes come from WP_Scripts::do_item().
'<script src="https://cdn.ampproject.org/v0/amp-ad-latest.js" async="" custom-element="amp-ad"></script>',
'<script src="https://cdn.ampproject.org/v0/amp-audio-latest.js" async="" custom-element="amp-audio"></script>',
'<script src="https://cdn.ampproject.org/v0/amp-ad-latest.js" async="" custom-element="amp-ad"></script>',

'<link rel="icon" href="http://example.org/favicon.png" sizes="32x32">',
'<link rel="icon" href="http://example.org/favicon.png" sizes="192x192">',
Expand Down
8 changes: 4 additions & 4 deletions tests/test-tag-and-attribute-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1060,16 +1060,16 @@ public function test_replace_node_with_children_validation_errors() {
</div>
EOB;
$expected_errors[] = array(
'node_name' => 'bazfoo',
'node_name' => 'invalid_p',
'parent_name' => 'div',
'code' => 'invalid_element',
'node_attributes' => array(),
'node_attributes' => array( 'id' => 'invalid' ),
);
$expected_errors[] = array(
'node_name' => 'invalid_p',
'node_name' => 'bazfoo',
'parent_name' => 'div',
'code' => 'invalid_element',
'node_attributes' => array( 'id' => 'invalid' ),
'node_attributes' => array(),
);
$content[] = <<<EOB
<ul>
Expand Down