Mercurial > SimpleWebPresenter
view OnlineBufferValidator.inc @ 109:812b0cfa999f
Adding internal flags.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Mon, 07 Mar 2016 20:45:02 +0100 |
| parents | 2370f4450983 |
| children |
line wrap: on
line source
<?php include_once 'ScriptIncludeCache.inc'; /// @cond $baseDir = dirname(__FILE__); $cache = ScriptIncludeCache::instance(__FILE__); $cache->includeOnce('Http.inc', $baseDir); $cache->includeOnce('OnlineValidator.inc', $baseDir); /// @endcond /** * Defines a validator which uses an online validator and a buffer * with the content */ class OnlineBufferValidator extends OnlineValidator { private $buffer; /** * Constructs an OnlineURIValidator * * @param $buffer The buffer to validate */ function __construct($buffer) { $this->buffer = $buffer; } function check() { $params = array( 'fragment' => $this->buffer); $headers = Http::postHeaders($this->validator_url , $params, 2); return $headers['X-W3C-Validator-Status'] === "Valid"; } } ?>
