r48399 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48398‎ | r48399 | r48400 >
Date:02:17, 14 March 2009
Author:demon
Status:reverted (Comments)
Tags:
Comment:
Check if the path is writable before trying to mkdir().
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2008,6 +2008,9 @@
20092009 if ( is_null( $mode ) )
20102010 $mode = $wgDirectoryMode;
20112011
 2012+ if ( !is_writable( $dir ) ) {
 2013+ return false;
 2014+ }
20122015 return mkdir( $dir, $mode, true ); // PHP5 <3
20132016 }
20142017

Follow-up revisions

RevisionCommit summaryAuthorDate
r48416(bug 17992) Revert crack-inspired r48399.demon13:45, 15 March 2009

Comments

#Comment by Mormegil (talk | contribs)   09:37, 15 March 2009

I don’t know what this should have accomplished, but it has broken uploads at least for me on Windows.

PHP documentation on is_writable [1] says: “Returns TRUE if the filename exists and is writable.” (emphasis mine), so I just can’t see how this could possibly work at all.

#Comment by Werdna (talk | contribs)   13:33, 15 March 2009

See bug 17992.

#Comment by 😂 (talk | contribs)   13:46, 15 March 2009

Reverted in r48416

Status & tagging log