dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add i18n for the infamous "Fatal exception of type MWException" errorbox
[lhc/web/wiklou.git]
/
includes
/
HttpFunctions.php
diff --git
a/includes/HttpFunctions.php
b/includes/HttpFunctions.php
index
8302124
..
d066df8
100644
(file)
--- a/
includes/HttpFunctions.php
+++ b/
includes/HttpFunctions.php
@@
-59,7
+59,6
@@
class Http {
*/
public static function request( $method, $url, $options = array() ) {
wfDebug( "HTTP: $method: $url\n" );
*/
public static function request( $method, $url, $options = array() ) {
wfDebug( "HTTP: $method: $url\n" );
- wfProfileIn( __METHOD__ . "-$method" );
$options['method'] = strtoupper( $method );
$options['method'] = strtoupper( $method );
@@
-77,7
+76,6
@@
class Http {
if ( $status->isOK() ) {
$content = $req->getContent();
}
if ( $status->isOK() ) {
$content = $req->getContent();
}
- wfProfileOut( __METHOD__ . "-$method" );
return $content;
}
return $content;
}
@@
-114,7
+112,7
@@
class Http {
* @return bool
*/
public static function isLocalURL( $url ) {
* @return bool
*/
public static function isLocalURL( $url ) {
- global $wgCommandLineMode, $wgConf;
+ global $wgCommandLineMode, $wg
LocalVirtualHosts, $wg
Conf;
if ( $wgCommandLineMode ) {
return false;
if ( $wgCommandLineMode ) {
return false;
@@
-126,7
+124,7
@@
class Http {
$host = $matches[1];
// Split up dotwise
$domainParts = explode( '.', $host );
$host = $matches[1];
// Split up dotwise
$domainParts = explode( '.', $host );
- // Check if this domain or any superdomain is listed
in $wgConf
as a local virtual host
+ // Check if this domain or any superdomain is listed as a local virtual host
$domainParts = array_reverse( $domainParts );
$domain = '';
$domainParts = array_reverse( $domainParts );
$domain = '';
@@
-139,7
+137,9
@@
class Http {
$domain = $domainPart . '.' . $domain;
}
$domain = $domainPart . '.' . $domain;
}
- if ( $wgConf->isLocalVHost( $domain ) ) {
+ if ( in_array( $domain, $wgLocalVirtualHosts )
+ || $wgConf->isLocalVHost( $domain )
+ ) {
return true;
}
}
return true;
}
}
@@
-434,7
+434,6
@@
class MWHttpRequest {
* @return Status
*/
public function execute() {
* @return Status
*/
public function execute() {
- wfProfileIn( __METHOD__ );
$this->content = "";
$this->content = "";
@@
-452,7
+451,6
@@
class MWHttpRequest {
$this->setUserAgent( Http::userAgent() );
}
$this->setUserAgent( Http::userAgent() );
}
- wfProfileOut( __METHOD__ );
}
/**
}
/**
@@
-461,7
+459,6
@@
class MWHttpRequest {
* found in an array in the member variable headerList.
*/
protected function parseHeader() {
* found in an array in the member variable headerList.
*/
protected function parseHeader() {
- wfProfileIn( __METHOD__ );
$lastname = "";
$lastname = "";
@@
-480,7
+477,6
@@
class MWHttpRequest {
$this->parseCookies();
$this->parseCookies();
- wfProfileOut( __METHOD__ );
}
/**
}
/**
@@
-614,7
+610,6
@@
class MWHttpRequest {
* Parse the cookies in the response headers and store them in the cookie jar.
*/
protected function parseCookies() {
* Parse the cookies in the response headers and store them in the cookie jar.
*/
protected function parseCookies() {
- wfProfileIn( __METHOD__ );
if ( !$this->cookieJar ) {
$this->cookieJar = new CookieJar;
if ( !$this->cookieJar ) {
$this->cookieJar = new CookieJar;
@@
-627,7
+622,6
@@
class MWHttpRequest {
}
}
}
}
- wfProfileOut( __METHOD__ );
}
/**
}
/**
@@
-715,12
+709,10
@@
class CurlHttpRequest extends MWHttpRequest {
}
public function execute() {
}
public function execute() {
- wfProfileIn( __METHOD__ );
parent::execute();
if ( !$this->status->isOK() ) {
parent::execute();
if ( !$this->status->isOK() ) {
- wfProfileOut( __METHOD__ );
return $this->status;
}
return $this->status;
}
@@
-766,7
+758,6
@@
class CurlHttpRequest extends MWHttpRequest {
$curlHandle = curl_init( $this->url );
if ( !curl_setopt_array( $curlHandle, $this->curlOptions ) ) {
$curlHandle = curl_init( $this->url );
if ( !curl_setopt_array( $curlHandle, $this->curlOptions ) ) {
- wfProfileOut( __METHOD__ );
throw new MWException( "Error setting curl options." );
}
throw new MWException( "Error setting curl options." );
}
@@
-795,8
+786,6
@@
class CurlHttpRequest extends MWHttpRequest {
$this->parseHeader();
$this->setStatus();
$this->parseHeader();
$this->setStatus();
- wfProfileOut( __METHOD__ );
-
return $this->status;
}
return $this->status;
}
@@
-832,7
+821,6
@@
class PhpHttpRequest extends MWHttpRequest {
}
public function execute() {
}
public function execute() {
- wfProfileIn( __METHOD__ );
parent::execute();
parent::execute();
@@
-938,13
+926,11
@@
class PhpHttpRequest extends MWHttpRequest {
if ( $fh === false ) {
$this->status->fatal( 'http-request-error' );
if ( $fh === false ) {
$this->status->fatal( 'http-request-error' );
- wfProfileOut( __METHOD__ );
return $this->status;
}
if ( $result['timed_out'] ) {
$this->status->fatal( 'http-timed-out', $this->url );
return $this->status;
}
if ( $result['timed_out'] ) {
$this->status->fatal( 'http-timed-out', $this->url );
- wfProfileOut( __METHOD__ );
return $this->status;
}
return $this->status;
}
@@
-966,8
+952,6
@@
class PhpHttpRequest extends MWHttpRequest {
}
fclose( $fh );
}
fclose( $fh );
- wfProfileOut( __METHOD__ );
-
return $this->status;
}
}
return $this->status;
}
}