Really, I'm not sure about the usefulness of exploding with a MWException anytime we can't do an external request, but at least we can stop the installer from exploding :)
* Removed AjaxFunctions.php. The last remaining function js_unescape() was moved
to the FCKEditor extension.
* (bug 28762) Resizing to specified height broken for very thin images
+* (bug 29959) Installer fatal when cURL and allow_url_fopen is disabled and user
+ tries to subsribe to mediawiki-announce
=== API changes in 1.19 ===
* BREAKING CHANGE: action=watch now requires POST and token.
}
}
+ /**
+ * Simple function to test if we can make any sort of requests at all, using
+ * cURL or fopen()
+ * @return bool
+ */
+ public static function canMakeRequests() {
+ return function_exists( 'curl_init' ) || wfIniGetBool( 'allow_url_fopen' );
+ }
+
/**
* Generate a new request object
* @param $url String: url to use
'config-insecure-keys' => "'''Warning:''' {{PLURAL:$2|A secure key|Secure keys}} ($1) generated during installation {{PLURAL:$2|is|are}} not completely safe. Consider changing {{PLURAL:$2|it|them}} manually.",
'config-install-sysop' => 'Creating administrator user account',
'config-install-subscribe-fail' => 'Unable to subscribe to mediawiki-announce: $1',
+ 'config-install-subscribe-notpossible' => 'cURL is not installed and allow_url_fopen is not available.',
'config-install-mainpage' => 'Creating main page with default content',
'config-install-extension-tables' => 'Creating tables for enabled extensions',
'config-install-mainpage-failed' => 'Could not insert main page: $1',
$params['language'] = $myLang;
}
- $res = MWHttpRequest::factory( $this->mediaWikiAnnounceUrl,
- array( 'method' => 'POST', 'postData' => $params ) )->execute();
- if( !$res->isOK() ) {
- $s->warning( 'config-install-subscribe-fail', $res->getMessage() );
+ if( MWHttpRequest::canMakeRequests() ) {
+ $res = MWHttpRequest::factory( $this->mediaWikiAnnounceUrl,
+ array( 'method' => 'POST', 'postData' => $params ) )->execute();
+ if( !$res->isOK() ) {
+ $s->warning( 'config-install-subscribe-fail', $res->getMessage() );
+ }
+ } else {
+ $s->warning( 'config-install-subscribe-notpossible' );
}
}