Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -171,6 +171,8 @@ |
172 | 172 | * Removed AjaxFunctions.php. The last remaining function js_unescape() was moved |
173 | 173 | to the FCKEditor extension. |
174 | 174 | * (bug 28762) Resizing to specified height broken for very thin images |
| 175 | +* (bug 29959) Installer fatal when cURL and allow_url_fopen is disabled and user |
| 176 | + tries to subsribe to mediawiki-announce |
175 | 177 | |
176 | 178 | === API changes in 1.19 === |
177 | 179 | * BREAKING CHANGE: action=watch now requires POST and token. |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -1466,10 +1466,14 @@ |
1467 | 1467 | $params['language'] = $myLang; |
1468 | 1468 | } |
1469 | 1469 | |
1470 | | - $res = MWHttpRequest::factory( $this->mediaWikiAnnounceUrl, |
1471 | | - array( 'method' => 'POST', 'postData' => $params ) )->execute(); |
1472 | | - if( !$res->isOK() ) { |
1473 | | - $s->warning( 'config-install-subscribe-fail', $res->getMessage() ); |
| 1470 | + if( MWHttpRequest::canMakeRequests() ) { |
| 1471 | + $res = MWHttpRequest::factory( $this->mediaWikiAnnounceUrl, |
| 1472 | + array( 'method' => 'POST', 'postData' => $params ) )->execute(); |
| 1473 | + if( !$res->isOK() ) { |
| 1474 | + $s->warning( 'config-install-subscribe-fail', $res->getMessage() ); |
| 1475 | + } |
| 1476 | + } else { |
| 1477 | + $s->warning( 'config-install-subscribe-notpossible' ); |
1474 | 1478 | } |
1475 | 1479 | } |
1476 | 1480 | |
Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -520,6 +520,7 @@ |
521 | 521 | '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.", |
522 | 522 | 'config-install-sysop' => 'Creating administrator user account', |
523 | 523 | 'config-install-subscribe-fail' => 'Unable to subscribe to mediawiki-announce: $1', |
| 524 | + 'config-install-subscribe-notpossible' => 'cURL is not installed and allow_url_fopen is not available.', |
524 | 525 | 'config-install-mainpage' => 'Creating main page with default content', |
525 | 526 | 'config-install-extension-tables' => 'Creating tables for enabled extensions', |
526 | 527 | 'config-install-mainpage-failed' => 'Could not insert main page: $1', |
Index: trunk/phase3/includes/HttpFunctions.php |
— | — | @@ -210,6 +210,15 @@ |
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
| 214 | + * Simple function to test if we can make any sort of requests at all, using |
| 215 | + * cURL or fopen() |
| 216 | + * @return bool |
| 217 | + */ |
| 218 | + public static function canMakeRequests() { |
| 219 | + return function_exists( 'curl_init' ) || wfIniGetBool( 'allow_url_fopen' ); |
| 220 | + } |
| 221 | + |
| 222 | + /** |
214 | 223 | * Generate a new request object |
215 | 224 | * @param $url String: url to use |
216 | 225 | * @param $options Array: (optional) extra params to pass (see Http::request()) |