Revert r35819 -- broke thumbnailing.
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 3 Jun 2008 23:46:56 +0000 (23:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 3 Jun 2008 23:46:56 +0000 (23:46 +0000)
  10 previously passing test(s) now FAILING! :(
      * Thumbnail image caption with a free URL  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A ISBN with a thumbnail  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A RFC with a thumbnail  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A mailto link with a thumbnail  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A <math> with a thumbnail- we don't render math in the parsertests by default,
so math is not stripped and turns up as escaped &lt;math&gt; tags.  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887, part 2: A <math> with a thumbnail- math enabled  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * Image caption containing another image  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * Bug 3090: External links other than http: in image captions  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * Width + Height sized image (using px) (height is ignored)  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * <references> after <gallery> (bug 6164)  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]

includes/GlobalFunctions.php

index 69458a4..95a1819 100644 (file)
@@ -1706,48 +1706,7 @@ function wfMkdirParents( $fullDir, $mode = 0777 ) {
                return true;
        if( file_exists( $fullDir ) )
                return true;
-
-       # Go back through the paths to find the first directory that exists
-       $currentDir = $fullDir;
-       $createList = array();
-       while ( strval( $currentDir ) !== '' && !file_exists( $currentDir ) ) {
-               # Strip trailing slashes
-               $currentDir = rtrim( $currentDir, '/\\' );
-
-               # Add to create list
-               $createList[] = $currentDir;
-
-               # Find next delimiter searching from the end
-               $p = max( strrpos( $currentDir, '/' ), strrpos( $currentDir, '\\' ) );
-               if ( $p === false ) {
-                       $currentDir = false;
-               } else {
-                       $currentDir = substr( $currentDir, 0, $p );
-               }
-       }
-       
-       if ( count( $createList ) == 0 ) {
-               # Directory specified already exists
-               return true;
-       } elseif ( $currentDir === false ) {
-               # Went all the way back to root and it apparently doesn't exist
-               return false;
-       }
-       
-       # Now go forward creating directories
-       $createList = array_reverse( $createList );
-       foreach ( $createList as $dir ) {
-               # Check first to avoid spamming with warnings
-               if ( !is_writable( $dir ) ) {
-                       return false;
-               }
-               # use chmod to override the umask, as suggested by the PHP manual
-               if ( !mkdir( $dir, $mode ) || !chmod( $dir, $mode ) ) {
-                       wfDebugLog( 'mkdir', "Unable to create directory $dir\n" );
-                       return false;
-               }
-       }
-       return true;
+       return mkdir( str_replace( '/', DIRECTORY_SEPARATOR, $fullDir ), $mode, true );
 }
 
 /**