Index: trunk/extensions/HelpCommons/HelpCommons.php |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | $wgOut->clearHTML(); |
122 | 122 | } |
123 | 123 | |
124 | | - $response = file_get_contents( $url . $prefix . '/api.php?format=json&action=parse&prop=text|categorieshtml&redirects&disablepp&pst&text={{:Help:' . $dbkey . '}}' ); |
| 124 | + $response = Http::get( $url . $prefix . '/api.php?format=json&action=parse&prop=text|categorieshtml&redirects&disablepp&pst&text={{:Help:' . $dbkey . '}}' ); |
125 | 125 | $data = json_decode( $response, /*assoc=*/ true ); |
126 | 126 | $text = $data['parse']['text']['*']; |
127 | 127 | $text_html = str_replace( '<span class="editsection">[<a href="'.$prefix.'/', '<span class="editsection">[<a href="'.$url.$prefix.'/', $text ); // re-locate [edit] links to help wiki |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | } |
185 | 185 | |
186 | 186 | // check if requested page does exist |
187 | | - $apiResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $dbkey ); |
| 187 | + $apiResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $dbkey ); |
188 | 188 | $apiData = unserialize( $apiResponse ); |
189 | 189 | |
190 | 190 | if ( !$apiResponse ) { |
— | — | @@ -251,7 +251,7 @@ |
252 | 252 | |
253 | 253 | |
254 | 254 | // check if requested page does exist |
255 | | - $apiResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $talkpage->getTitle()->getDBkey() ); |
| 255 | + $apiResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $talkpage->getTitle()->getDBkey() ); |
256 | 256 | $apiData = unserialize( $apiResponse ); |
257 | 257 | |
258 | 258 | if ( !$apiResponse ) { |
— | — | @@ -338,7 +338,7 @@ |
339 | 339 | |
340 | 340 | |
341 | 341 | // check if requested page does exist |
342 | | - $apiResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $action->getTitle()->getDBkey() ); |
| 342 | + $apiResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $action->getTitle()->getDBkey() ); |
343 | 343 | $apiData = unserialize( $apiResponse ); |
344 | 344 | |
345 | 345 | if ( !$apiResponse ) { |
— | — | @@ -547,7 +547,7 @@ |
548 | 548 | |
549 | 549 | case 'existing': |
550 | 550 | // check if requested page does exist |
551 | | - $apiResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $title->getDBkey() ); |
| 551 | + $apiResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $title->getDBkey() ); |
552 | 552 | $apiData = unserialize( $apiResponse ); |
553 | 553 | |
554 | 554 | if ( !$apiResponse ) { |
— | — | @@ -631,7 +631,7 @@ |
632 | 632 | } |
633 | 633 | |
634 | 634 | // check if requested page does exist |
635 | | - $apiResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $target->getDBkey() ); |
| 635 | + $apiResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $target->getDBkey() ); |
636 | 636 | $apiData = unserialize( $apiResponse ); |
637 | 637 | |
638 | 638 | if ( !$apiResponse ) { |
— | — | @@ -698,7 +698,7 @@ |
699 | 699 | } |
700 | 700 | |
701 | 701 | // check if requested page does exist |
702 | | - $apiResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $page->getDBkey() ); |
| 702 | + $apiResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $page->getDBkey() ); |
703 | 703 | $apiData = unserialize( $apiResponse ); |
704 | 704 | |
705 | 705 | if ( !$apiResponse ) { |
— | — | @@ -762,7 +762,7 @@ |
763 | 763 | } |
764 | 764 | |
765 | 765 | // check if requested page does exist |
766 | | - $apiPageResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $talk->getDBkey() ); |
| 766 | + $apiPageResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $talk->getDBkey() ); |
767 | 767 | $apiPageData = unserialize( $apiPageResponse ); |
768 | 768 | |
769 | 769 | if ( !$apiPageResponse ) { |
— | — | @@ -778,7 +778,7 @@ |
779 | 779 | } |
780 | 780 | |
781 | 781 | // check if requested talkpage does exist |
782 | | - $apiTalkResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help_talk:' . $talk->getDBkey() ); |
| 782 | + $apiTalkResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help_talk:' . $talk->getDBkey() ); |
783 | 783 | $apiTalkData = unserialize( $apiTalkResponse ); |
784 | 784 | |
785 | 785 | if ( !$apiTalkResponse ) { |