src/Control/ContentNegotiator.php
public static function enabled_for($response)
    {
        $contentType = $response->getHeader("Content-Type");

        // Disable content negotiation for other content types
        if ($contentType
            && substr($contentType, 0, 9) != 'text/html'
            && substr($contentType, 0, 21) != 'application/xhtml+xml'
        ) {
            return false;
        }

        if (ContentNegotiator::getEnabled()) {
            return true;
        } else {
            return (substr($response->getBody(), 0, 5) == '<' . '?xml');
        }
    }
public static function enabled_for($response)
    {
        $contentType = $response->getHeader("Content-Type");

        // Disable content negotiation for other content types
        if ($contentType
            && substr($contentType, 0, 9) != 'text/html'
            && substr($contentType, 0, 21) != 'application/xhtml+xml'
        ) {
            return false;
        }

        if (ContentNegotiator::getEnabled()) {
            return true;
        } else {
            return (substr($response->getBody(), 0, 5) == '<' . '?xml');
        }
    }
public static function enabled_for ( $ response ) { $ contentType = $ response -> getHeader ( "Content-Type" ) ; // Disable content negotiation for other content types if ( $ contentType && substr ( $ contentType , 0 , 9 ) != 'text/html' && substr ( $ contentType , 0 , 21 ) != 'application/xhtml+xml' ) { return false ; } if ( ContentNegotiator :: getEnabled ( ) ) { return true ; } else { return ( substr ( $ response -> getBody ( ) , 0 , 5 ) == '<' . '?xml' ) ; } }
Returns true if negotiation is enabled for the given response. By default, negotiation is only
enabled for pages that have the xml header.

@param HTTPResponse $response
@return bool
Returns true if negotiation is enabled for the given response . By default negotiation is only enabled for pages that have the xml header .