"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "includes/http/PhpHttpRequest.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

PhpHttpRequest.php  (mediawiki-1.31.1):PhpHttpRequest.php  (mediawiki-1.32.0)
skipping to change at line 140 skipping to change at line 140
if ( $this->proxy ) { if ( $this->proxy ) {
$options['http']['proxy'] = $this->urlToTcp( $this->proxy ); $options['http']['proxy'] = $this->urlToTcp( $this->proxy );
$options['http']['request_fulluri'] = true; $options['http']['request_fulluri'] = true;
} }
if ( $this->postData ) { if ( $this->postData ) {
$options['http']['content'] = $this->postData; $options['http']['content'] = $this->postData;
} }
if ( $this->sslVerifyHost ) { if ( $this->sslVerifyHost ) {
// PHP 5.6.0 deprecates CN_match, in favour of peer_name $options['ssl']['peer_name'] = $this->parsedUrl['host'];
which
// actually checks SubjectAltName properly.
if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) {
$options['ssl']['peer_name'] = $this->parsedUrl['
host'];
} else {
$options['ssl']['CN_match'] = $this->parsedUrl['h
ost'];
}
} }
$options['ssl'] += $this->getCertOptions(); $options['ssl'] += $this->getCertOptions();
$context = stream_context_create( $options ); $context = stream_context_create( $options );
$this->headerList = []; $this->headerList = [];
$reqCount = 0; $reqCount = 0;
$url = $this->url; $url = $this->url;
skipping to change at line 172 skipping to change at line 166
); );
} }
do { do {
$reqCount++; $reqCount++;
$this->fopenErrors = []; $this->fopenErrors = [];
set_error_handler( [ $this, 'errorHandler' ] ); set_error_handler( [ $this, 'errorHandler' ] );
$fh = fopen( $url, "r", false, $context ); $fh = fopen( $url, "r", false, $context );
restore_error_handler(); restore_error_handler();
if ( !$fh ) { if ( !$fh ) {
// HACK for instant commons.
// If we are contacting (commons|upload).wikimedi
a.org
// try again with CN_match for en.wikipedia.org
// as php does not handle SubjectAltName properly
// prior to "peer_name" option in php 5.6
if ( isset( $options['ssl']['CN_match'] )
&& ( $options['ssl']['CN_match'] === 'com
mons.wikimedia.org'
|| $options['ssl']['CN_match'] ==
= 'upload.wikimedia.org' )
) {
$options['ssl']['CN_match'] = 'en.wikiped
ia.org';
$context = stream_context_create( $option
s );
continue;
}
break; break;
} }
$result = stream_get_meta_data( $fh ); $result = stream_get_meta_data( $fh );
$this->headerList = $result['wrapper_data']; $this->headerList = $result['wrapper_data'];
$this->parseHeader(); $this->parseHeader();
if ( !$this->followRedirects ) { if ( !$this->followRedirects ) {
break; break;
} }
 End of changes. 2 change blocks. 
28 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)