Mercurial > SimpleWebPresenter
view OnlineBufferValidator.inc.php @ 136:60bc8f62384d default tip
Use internal URL if available to generate Sitemap.
| author | Tom Fredrik Blenning <bfg@bfgconsult.no> |
|---|---|
| date | Mon, 23 Jan 2023 00:17:36 +0100 |
| parents | b6b4a58c7625 |
| children |
line wrap: on
line source
<?php include_once 'ScriptIncludeCache.inc.php'; /// @cond $baseDir = dirname(__FILE__); $cache = ScriptIncludeCache::instance(__FILE__); $cache->includeOnce('Http.inc.php', $baseDir); $cache->includeOnce('OnlineValidator.inc.php', $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"; } } ?>
