Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -689,20 +689,22 @@ |
690 | 690 | 2 => array('file', wfGetNull(), 'a') |
691 | 691 | ); |
692 | 692 | $pipes = array(); |
693 | | - $process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes); |
694 | | - if (is_resource($process)) { |
695 | | - // Theoretically, this style of communication could cause a deadlock |
696 | | - // here. If the stdout buffer fills up, then writes to stdin could |
697 | | - // block. This doesn't appear to happen with tidy, because tidy only |
698 | | - // writes to stdout after it's finished reading from stdin. Search |
699 | | - // for tidyParseStdin and tidySaveStdout in console/tidy.c |
700 | | - fwrite($pipes[0], $text); |
701 | | - fclose($pipes[0]); |
702 | | - while (!feof($pipes[1])) { |
703 | | - $cleansource .= fgets($pipes[1], 1024); |
| 693 | + if( function_exists('proc_open') ) { |
| 694 | + $process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes); |
| 695 | + if (is_resource($process)) { |
| 696 | + // Theoretically, this style of communication could cause a deadlock |
| 697 | + // here. If the stdout buffer fills up, then writes to stdin could |
| 698 | + // block. This doesn't appear to happen with tidy, because tidy only |
| 699 | + // writes to stdout after it's finished reading from stdin. Search |
| 700 | + // for tidyParseStdin and tidySaveStdout in console/tidy.c |
| 701 | + fwrite($pipes[0], $text); |
| 702 | + fclose($pipes[0]); |
| 703 | + while (!feof($pipes[1])) { |
| 704 | + $cleansource .= fgets($pipes[1], 1024); |
| 705 | + } |
| 706 | + fclose($pipes[1]); |
| 707 | + proc_close($process); |
704 | 708 | } |
705 | | - fclose($pipes[1]); |
706 | | - proc_close($process); |
707 | 709 | } |
708 | 710 | |
709 | 711 | wfProfileOut( $fname ); |