From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/tidy/RaggettInternalPHP.php | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 includes/tidy/RaggettInternalPHP.php (limited to 'includes/tidy/RaggettInternalPHP.php') diff --git a/includes/tidy/RaggettInternalPHP.php b/includes/tidy/RaggettInternalPHP.php new file mode 100644 index 00000000..1ce14b60 --- /dev/null +++ b/includes/tidy/RaggettInternalPHP.php @@ -0,0 +1,52 @@ +parseString( $text, $this->config['tidyConfigFile'], 'utf8' ); + + if ( $stderr ) { + $retval = $tidy->getStatus(); + return $tidy->errorBuffer; + } + + $tidy->cleanRepair(); + $retval = $tidy->getStatus(); + if ( $retval == 2 ) { + // 2 is magic number for fatal error + // http://www.php.net/manual/en/function.tidy-get-status.php + $cleansource = null; + } else { + $cleansource = tidy_get_output( $tidy ); + if ( !empty( $this->config['debugComment'] ) && $retval > 0 ) { + $cleansource .= "', '-->', $tidy->errorBuffer ) . + "\n-->"; + } + } + + return $cleansource; + } + + public function supportsValidate() { + return true; + } +} -- cgit v1.2.3-54-g00ecf