Last modified: 2011-09-21 15:02:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T24307, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22307 - Http::get within HttpFunction.php will not work with windows authentication.
Http::get within HttpFunction.php will not work with windows authentication.
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.13.x
All Windows XP
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: iis
  Show dependency treegraph
 
Reported: 2010-01-28 15:25 UTC by Mary Beebe
Modified: 2011-09-21 15:02 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mary Beebe 2010-01-28 15:25:22 UTC
The method Http::get, which is within includes/HttpFunction.php, will not work if you use windows authentication within IIS.  We believe it is because Integrated Windows Authentication does not allow automated access to a URL via PHP.   We noticed the error within the dump html extension: dumpHTML.inc in the method makeUrlSnapshot.  

We created this method as a work around.   It changes the url to a file using $IP.  See the comments for restrictions to this method.  


/**
    * Added to replace  function 'makeUrlSnapshot( $url )'.
    * MakeUrlSnapshot will not work with IIS and windows anonymous access. 
    * @param String $url - url of a file with $wgScriptPath as the prefix.
    * NOTE: It is important that url begins with $wgScriptPath.  
    */
   function copyUrlAsFile($url) {
        global $IP;

        $this->mkdir( "{$this->dest}/misc" );
        $destName = urldecode( basename( $url ) );
        $destPath = "{$this->dest}/misc/$destName"; 
        if ( !file_exists( $destPath ) ) {  
            //Replace scriptPath with $IP.  
            //Make sure to replace only the prefix.
            $pattern ='/^'. 
                  str_replace("/","\\/",$this->oldScriptPath) . '/';
            $newUrl = preg_replace($pattern,$IP,$url,1);
            copy($newUrl,$destPath);
        }
        return "{$this->articleBaseUrl}/misc/" . urlencode( $destName );
    }
Comment 1 Chad H. 2010-01-28 15:43:15 UTC
(In reply to comment #0)
> The method Http::get, which is within includes/HttpFunction.php, will not work
> if you use windows authentication within IIS.  We believe it is because
> Integrated Windows Authentication does not allow automated access to a URL via
> PHP.  

I don't think that's the case. From looking at the code (the 1.15.1 stable HttpFunctions, and trunk) it wouldn't appear that we're passing any sort of authentication headers along with our request. It might be a good idea to do so, if we're requesting data from an HTTP-authenticated source.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links