Add sslCAFile option to DatabaseMysqli
[mediawiki.git] / includes / tidy / TidyDriverBase.php
blob6e01894008c80898750329a669eb4da7a9e42c32
1 <?php
3 namespace MediaWiki\Tidy;
5 /**
6 * Base class for HTML cleanup utilities
7 */
8 abstract class TidyDriverBase {
9 protected $config;
11 function __construct( $config ) {
12 $this->config = $config;
15 /**
16 * Return true if validate() can be used
18 public function supportsValidate() {
19 return false;
22 /**
23 * Check HTML for errors, used if $wgValidateAllHtml = true.
25 * @param string $text
26 * @param string &$errorStr Return the error string
27 * @throws \MWException
28 * @return bool Whether the HTML is valid
30 public function validate( $text, &$errorStr ) {
31 throw new \MWException( static::class . ' does not support validate()' );
34 /**
35 * Clean up HTML
37 * @param string $text HTML document fragment to clean up
38 * @return string The corrected HTML output
40 abstract public function tidy( $text );