From: Gabriel Wicke Date: Thu, 6 May 2004 21:06:23 +0000 (+0000) Subject: pipe for stderr was troublesome on pages with many errors (buffer filled up), generic... X-Git-Tag: 1.3.0beta1~131 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=6267cadb18e9537753e69d1af7ff144cbc12f410;p=lhc%2Fweb%2Fwiklou.git pipe for stderr was troublesome on pages with many errors (buffer filled up), generic message now --- diff --git a/includes/Parser.php b/includes/Parser.php index 5c4d169696..ed67b7a08c 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -412,7 +412,7 @@ class Parser $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), - 2 => array("pipe", "w") + 2 => array("file", "/dev/null", "a") ); $process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts", $descriptorspec, $pipes); if (is_resource($process)) { @@ -423,16 +423,9 @@ class Parser } fclose($pipes[1]); $return_value = proc_close($process); - if($return_value == 2) { - $errors = ''; - while (!feof($pipes[2])) { - $errors .= fgets($pipes[2], 1024); - } - } - fclose($pipes[2]); } - if( $cleansource == '' and !empty($errors)) { - return '
'.htmlspecialchars($errors).'
'; + if( $cleansource == '' && $text != '') { + return '

'.wfMsg('seriousxhtmlerrors').'

'.htmlspecialchars($text).'
'; } else { return $cleansource; } @@ -1627,7 +1620,7 @@ class Parser foreach ( $bits as $x ) { preg_match( "/^(\\/?)(\\w+)([^>]*)(\\/{0,1}>)([^<]*)$/", $x, $regs ); - list( $qbar, $slash, $t, $params, $brace, $rest ) = $regs; + @list( $qbar, $slash, $t, $params, $brace, $rest ) = $regs; if ( in_array( $t = strtolower( $t ), $htmlelements ) ) { $newparams = $this->fixTagAttributes($params); $rest = str_replace( ">", ">", $rest );