Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.php |
— | — | @@ -1,8 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | 4 | KNOWN ISSUES: |
5 | | -- If no cURL is supported anf url_fopen[1] is disabled the |
6 | | - extension will not update |
7 | 5 | - Only works with SVN revision 50605 or later of the |
8 | 6 | Mediawiki core |
9 | 7 | */ |
— | — | @@ -201,12 +199,9 @@ |
202 | 200 | $langcode = strtolower($m[1]); |
203 | 201 | |
204 | 202 | //use cURL to get the SVN contents |
205 | | - if(is_callable("curl_init") && preg_match("/^http/",$basefile)) { |
206 | | - $ch = curl_init(); |
207 | | - curl_setopt($ch,CURLOPT_HEADER,0); |
208 | | - curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
209 | | - curl_setopt($ch,CURLOPT_URL,$basefile); |
210 | | - if(!$basefilecontents = curl_exec($ch)) { |
| 203 | + if(preg_match("/^http/",$basefile)) { |
| 204 | + $basefilecontents = Http::get($basefile); |
| 205 | + if(empty($basefilecontents)) { |
211 | 206 | myLog("Can't get the contents of ".$basefile." (curl)"); |
212 | 207 | return array(); |
213 | 208 | } |
— | — | @@ -244,12 +239,9 @@ |
245 | 240 | eval($basefilecontents); |
246 | 241 | |
247 | 242 | //use cURL to get the contents |
248 | | - if(is_callable("curl_init") && preg_match("/^http/",$comparefile)) { |
249 | | - $ch = curl_init(); |
250 | | - curl_setopt($ch,CURLOPT_HEADER,0); |
251 | | - curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
252 | | - curl_setopt($ch,CURLOPT_URL,$comparefile); |
253 | | - if(!$comparefilecontents = curl_exec($ch)) { |
| 243 | + if(preg_match("/^http/",$comparefile)) { |
| 244 | + $comparefilecontents = Http::get($comparefile); |
| 245 | + if(empty($comparefilecontents)) { |
254 | 246 | myLog("Can't get the contents of ".$comparefile." (curl)"); |
255 | 247 | return array(); |
256 | 248 | } |
— | — | @@ -366,13 +358,9 @@ |
367 | 359 | $compare_messages = array(); |
368 | 360 | $base_messages = array(); |
369 | 361 | |
370 | | - //use cURL to get the file contents |
371 | | - if(is_callable("curl_init") && preg_match("/^http/",$basefile)) { |
372 | | - $ch = curl_init(); |
373 | | - curl_setopt($ch,CURLOPT_HEADER,0); |
374 | | - curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
375 | | - curl_setopt($ch,CURLOPT_URL,$basefile); |
376 | | - if(!$basefilecontents = curl_exec($ch)) { |
| 362 | + if(preg_match("/^http/",$basefile)) { |
| 363 | + $basefilecontents = Http::get($basefile); |
| 364 | + if(empty($basefilecontents)) { |
377 | 365 | myLog("Can't get the contents of ".$basefile." (curl)"); |
378 | 366 | return 0; |
379 | 367 | } |
— | — | @@ -411,12 +399,9 @@ |
412 | 400 | eval($basefilecontents); |
413 | 401 | |
414 | 402 | //Use cURL when available |
415 | | - if(is_callable("curl_init") && preg_match("/^http/",$comparefile)) { |
416 | | - $ch = curl_init(); |
417 | | - curl_setopt($ch,CURLOPT_HEADER,0); |
418 | | - curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
419 | | - curl_setopt($ch,CURLOPT_URL,$comparefile); |
420 | | - if(!$comparefilecontents = curl_exec($ch)) { |
| 403 | + if(preg_match("/^http/",$comparefile)) { |
| 404 | + $comparefilecontents = Http::get($comparefile); |
| 405 | + if(empty($comparefilecontents)) { |
421 | 406 | myLog("Can't get the contents of ".$comparefile." (curl)"); |
422 | 407 | return 0; |
423 | 408 | } |
Index: trunk/extensions/LocalisationUpdate/KNOWN_ISSUES.txt |
— | — | @@ -1,4 +1,2 @@ |
2 | | -- If no cURL is supported and url_fopen[1] is disabled the |
3 | | - extension will not update |
4 | 2 | - Only works with SVN revision 50605 or later of the |
5 | 3 | MediaWiki core |