private function calculateFrameOptions()
    {
        $retval = null;

        $nb_site = $this->nb_request->getSite();

        switch ($nb_site->getXFrameOptions()) {
            case 'D':
                $retval = 'DENY';
                break;
            case 'S':
                $retval = 'SAMEORIGIN';
                break;
            case 'A':
                if (is_string($url = $nb_site->getXFrameOptionsURL()) &&
                    strlen($url = preg_replace(array('/^\s*/', '/\s*$/'), '', $url)) > 0) {
                    $retval = 'ALLOW-FROM ' . $url;
                } else {
                    throw new ENabuHTTPException(ENabuHTTPException::ERROR_X_FRAME_OPTIONS_URL_NOT_FOUND);
                }
        }

        return $retval;
    }
private function calculateFrameOptions()
    {
        $retval = null;

        $nb_site = $this->nb_request->getSite();

        switch ($nb_site->getXFrameOptions()) {
            case 'D':
                $retval = 'DENY';
                break;
            case 'S':
                $retval = 'SAMEORIGIN';
                break;
            case 'A':
                if (is_string($url = $nb_site->getXFrameOptionsURL()) &&
                    strlen($url = preg_replace(array('/^\s*/', '/\s*$/'), '', $url)) > 0) {
                    $retval = 'ALLOW-FROM ' . $url;
                } else {
                    throw new ENabuHTTPException(ENabuHTTPException::ERROR_X_FRAME_OPTIONS_URL_NOT_FOUND);
                }
        }

        return $retval;
    }
private function calculateFrameOptions ( ) { $ retval = null ; $ nb_site = $ this -> nb_request -> getSite ( ) ; switch ( $ nb_site -> getXFrameOptions ( ) ) { case 'D' : $ retval = 'DENY' ; break ; case 'S' : $ retval = 'SAMEORIGIN' ; break ; case 'A' : if ( is_string ( $ url = $ nb_site -> getXFrameOptionsURL ( ) ) && strlen ( $ url = preg_replace ( array ( '/^\s*/' , '/\s*$/' ) , '' , $ url ) ) > 0 ) { $ retval = 'ALLOW-FROM ' . $ url ; } else { throw new ENabuHTTPException ( ENabuHTTPException :: ERROR_X_FRAME_OPTIONS_URL_NOT_FOUND ) ; } } return $ retval ; }
Calculates the X-Frame-Options value if setted.
@return string|null If X-Frame-Options is setted returns the proper value,
else if not is setted then returns null.
@throws ENabuHTTPException Raises an exception if kind is ALLOW-FROM and none URL is setted.
Calculates the X - Frame - Options value if setted .