File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2032,6 +2032,8 @@ public static function finalize_validation( Document $dom ) {
2032
2032
return true ;
2033
2033
}
2034
2034
2035
+ $ sandboxing_level = amp_get_sandboxing_level ();
2036
+
2035
2037
/*
2036
2038
* In AMP-first, documents with invalid AMP markup can still be served. The amp attribute will be omitted in
2037
2039
* order to prevent GSC from complaining about a validation error already surfaced inside of WordPress.
@@ -2041,8 +2043,10 @@ public static function finalize_validation( Document $dom ) {
2041
2043
* Otherwise, if in Paired AMP then redirect to the non-AMP version if the current user isn't an user who
2042
2044
* can manage validation error statuses (access developer tools) and change the AMP options for the template
2043
2045
* mode. Such users should be able to see kept invalid markup on the AMP page even though it is invalid.
2046
+ *
2047
+ * Also, if sandboxing is not set to strict mode, then the page should be displayed to the user.
2044
2048
*/
2045
- if ( amp_is_canonical () ) {
2049
+ if ( amp_is_canonical () || ( 1 === $ sandboxing_level || 2 === $ sandboxing_level ) ) {
2046
2050
return true ;
2047
2051
}
2048
2052
You can’t perform that action at this time.
0 commit comments