Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2310,4 +2310,14 @@ |
2311 | 2311 | } |
2312 | 2312 | } |
2313 | 2313 | |
2314 | | - |
| 2314 | +/** |
| 2315 | + * Get a platform-independent path to the null file, e.g. |
| 2316 | + * /dev/null |
| 2317 | + * |
| 2318 | + * @return string |
| 2319 | + */ |
| 2320 | +function wfGetNull() { |
| 2321 | + return wfIsWindows() |
| 2322 | + ? 'NUL' |
| 2323 | + : '/dev/null'; |
| 2324 | +} |
\ No newline at end of file |
Index: trunk/phase3/includes/Parser.php |
— | — | @@ -753,7 +753,7 @@ |
754 | 754 | $descriptorspec = array( |
755 | 755 | 0 => array('pipe', 'r'), |
756 | 756 | 1 => array('pipe', 'w'), |
757 | | - 2 => array('file', '/dev/null', 'a') // FIXME: this line in UNIX-specific, it generates a warning on Windows, because /dev/null is not a valid Windows file. |
| 757 | + 2 => array('file', wfGetNull(), 'a') |
758 | 758 | ); |
759 | 759 | $pipes = array(); |
760 | 760 | $process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes); |
Index: trunk/phase3/includes/Export.php |
— | — | @@ -558,7 +558,7 @@ |
559 | 559 | $command = "7za a -bd -si " . wfEscapeShellArg( $file ); |
560 | 560 | // Suppress annoying useless crap from p7zip |
561 | 561 | // Unfortunately this could suppress real error messages too |
562 | | - $command .= " >/dev/null 2>&1"; |
| 562 | + $command .= ' ' . wfGetNull() . ' 2>&1'; |
563 | 563 | parent::DumpPipeOutput( $command ); |
564 | 564 | } |
565 | 565 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -382,6 +382,8 @@ |
383 | 383 | * (bug 10763) Fix multi-insert logic for PostgreSQL |
384 | 384 | * Fix invalid XHTML when viewing a deleted revision |
385 | 385 | * Fix syntax error in translations of magic words in Romanian language |
| 386 | +* (bug 8737) Fix warnings caused by incorrect use of `/dev/null` when piping |
| 387 | + process error output under Windows |
386 | 388 | |
387 | 389 | == API changes since 1.10 == |
388 | 390 | |