https://bugzilla.wikimedia.org/show_bug.cgi?id=18656

           Summary: Unable to upload files on Windows installation
           Product: MediaWiki
           Version: 1.14.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: Normal
         Component: Uploading
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Installed mediawiki 1.14 onto XP windows computer running IIS version 6, php
version 5.1.2 (isapi), and mysql 5.0.51a-community-nt.

Every upload failed with a message "Unable to create public/x/xy". 

The problem appears to be the php recursive mkdir function on windows, which
only works with windows type path delimiters (backslash). 

I was able to fix this by inserting an extra line of code in the
includes/GlobalFunctions.php as below

function wfMkdirParents( $dir, $mode = null ) {
        global $wgDirectoryMode;

        if( strval( $dir ) === '' || file_exists( $dir ) )
                return true;

        if ( is_null( $mode ) )
                $mode = $wgDirectoryMode;

# Fix for windows
$dir = str_replace("/",DIRECTORY_SEPARATOR,$dir);

        return mkdir( $dir, $mode, true );  // PHP5 <3
}


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to