Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php |
— | — | @@ -398,21 +398,14 @@ |
399 | 399 | $foreignOptions = $wgMemc->get( $memcKey ); |
400 | 400 | |
401 | 401 | if ( !$foreignOptions ) { |
402 | | - $options = array(); |
403 | | - $options['method'] = 'GET'; |
404 | 402 | $url = 'http://en.wikipedia.org/w/api.php?action=query&prop=revisions&&rvlimit=1&rvprop=content&format=json&titles=MediaWiki:' . $pageName; |
405 | | - $req = ( class_exists( 'MWHttpRequest' ) ) ? MWHttpRequest::factory( $url, $options ) : HttpRequest::factory( $url, $options ); |
| 403 | + $ret = Http::get( $url ); |
406 | 404 | |
407 | | - $status = $req->execute(); |
408 | | - |
409 | | - if ( !$status->isOK() ) { |
410 | | - $error = $req->getContent(); |
| 405 | + if ( !$ret ) { |
411 | 406 | wfProfileOut( __METHOD__ ); |
412 | 407 | return array( $key, $rev ); |
413 | 408 | } |
414 | 409 | |
415 | | - $ret = $req->getContent(); |
416 | | - |
417 | 410 | $jsonData = FormatJson::decode( $ret, true ); |
418 | 411 | |
419 | 412 | if ( isset( $jsonData['query']['pages'] ) ) { |