` under `text/html` is not a document * and must not have a `` grafted onto it. * * The default when a response declares no type at all is HTML, because that is * what WordPress serves and what PHP's own `default_mimetype` says. Defaulting * the other way would re-introduce the bug this file exists to fix, in a quieter * form: fixes silently withheld from ordinary pages, on any host whose * configuration happens not to surface a `Content-Type` here. */ class EqualSites_Response_Kind { /** * Types we will rewrite. `application/xhtml+xml` is here because the * applicator parses with DOM either way and a site serving real XHTML is a * site whose markup we can correct. */ const HTML_TYPES = array( 'text/html', 'application/xhtml+xml' ); /** * @param string $html The buffered response body. * @param array $headers Headers as `headers_list()` returns them: an array * of raw "Name: value" strings. * @return bool */ public static function is_html_document( $html, $headers ) { $type = self::content_type( $headers ); if ( null !== $type && ! in_array( $type, self::HTML_TYPES, true ) ) { return false; } return false !== stripos( $html, '