Turn wfMkdirParents() into just a thin wrapper around mkdir( $dir, $mode, true )...
authorIlmari Karonen <vyznev@users.mediawiki.org>
Fri, 21 Nov 2008 12:52:36 +0000 (12:52 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Fri, 21 Nov 2008 12:52:36 +0000 (12:52 +0000)
commit4051abe71559bed203633fbb43c2b12a3ba9f8c7
tree00a3d4029cf98ba488cc662edc0174b5ed2a8df9
parent2033b1fce5d895dca21d80326272faae236fc04c
Turn wfMkdirParents() into just a thin wrapper around mkdir( $dir, $mode, true ); this won't work in PHP4, but we don't support that, do we?

NOTE: the old code used to ignore the umask by explicitly forcing the permissions with chmod().  If this is desired behavior, it can be achieved by temporarily setting the umask to 0, as in:

$oldmask = umask( 0 );
$rv = mkdir( $dir, $mode, true );
umask( $oldmask );
return $rv;

However, I can't see why we'd want to do this.  In the worst case, users with excessively tight umasks can find themselves with unusable directories, but the proper solution to that is to fix the umask rather than to
ignore it.  In the best case, we've just plugged a security hole the user didn't realize they had (because they assumed their umask would Just Work).
includes/GlobalFunctions.php