Revert r44254 "Cleanup to wfGetNull(): * Add override in case /dev/null isn't accessi...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 10 Dec 2008 22:58:24 +0000 (22:58 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 10 Dec 2008 22:58:24 +0000 (22:58 +0000)
Doesn't seem like a proper fix here... At best, this'll be dumping random crap to some random file unless the user has a local copy of the /dev/null device file, which seems.... wrong. :)
For anything generating command lines, it probably won't make any difference (assuming exec() is enabled at all!) since open_basedir won't be searching through the command line (I think).
Assuming the core use case actually happens (open_basedir is set, but proc_open() is available to run tidy), a more correct fix is probably to go ahead and read in stderr and toss the results, or maybe better pass it through to PHP's stderr FD instead of opening /dev/null ourselves. Tidy has a -q option which should suppress random "hi i'm tidy version XYZ" if it's currently present.

RELEASE-NOTES
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/ProxyTools.php

index ca5e830..e406fb1 100644 (file)
@@ -68,8 +68,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   and should still be used in code meant to be compatible with v1.13 or older.
 * MediaWiki can be forced to use private IPs forwarded by a proxy server by
   using $wgUsePrivateIPs.
-* (bug 11009) The null file (ie: /dev/null) can be configured with $wgNullFile. 
-  Useful for overriding if the normal file isn't accessible
 
 === Migrated extensions ===
 The following extensions are migrated into MediaWiki 1.14:
index 4510a91..bdaad83 100644 (file)
@@ -169,13 +169,6 @@ $wgUploadBaseUrl    = "";
  */
 $wgDirectoryMode = 0777;
 
-/**
- * Path to null output (/dev/null on *nix, NUL on Windows)
- * Can be left unset unless you need to override it (ie:
- * open_basedir won't let you hit /dev/null. See bug 11009)
- */
-$wgNullFile = false;
-
 /**
  * New file storage paths; currently used only for deleted files.
  * Set it like this:
index d99bf67..4430440 100644 (file)
@@ -2816,10 +2816,6 @@ function wfLoadExtensionMessages( $extensionName, $langcode = false ) {
  * @return string
  */
 function wfGetNull() {
-       global $wgNullFile;
-       if ( $wgNullFile ) {
-               return $wgNullFile;
-       }
        return wfIsWindows()
                ? 'NUL'
                : '/dev/null';
index e7c22f8..771fd57 100644 (file)
@@ -166,7 +166,7 @@ function wfProxyCheck() {
                                                escapeshellarg( $port ),
                                                escapeshellarg( $url )
                                                ));
-                       exec( "php $params &>" . wfGetNull() . " &" );
+                       exec( "php $params &>/dev/null &" );
                }
                # Set MemCached key
                $wgMemc->set( $mcKey, 1, $wgProxyMemcExpiry );