Index: trunk/extensions/AmazonPlus/AmazonPlus.php |
— | — | @@ -24,11 +24,9 @@ |
25 | 25 | |
26 | 26 | # make sure that everything that needs to be set/loaded is that way |
27 | 27 | $err = ''; |
28 | | -if ( !ini_get( 'allow_url_fopen' ) ) { |
29 | | - # we need allow_url_fopen to be on in order for the file_get_contents() call to work on the amazon url |
30 | | - if ( ini_set( 'allow_url_fopen', 1 ) === false ) { |
31 | | - $err .= "\n<li>allow_url_fopen must be enabled in php.ini</li>"; |
32 | | - } |
| 28 | +if ( !wfIniGetBool( 'allow_url_fopen' ) && !extension_loaded( 'curl' ) ) { |
| 29 | + # we need allow_url_fopen or curl to be on in order for the Http::get() call to work on the amazon url |
| 30 | + $err .= "\n<li>allow_url_fopen or curl must be enabled in php.ini</li>"; |
33 | 31 | } |
34 | 32 | if ( !extension_loaded( 'simplexml' ) ) { |
35 | 33 | # we need the simplexml extension loaded to parse the xml string |
— | — | @@ -201,8 +199,8 @@ |
202 | 200 | $str .= wfUrlencode( $key ) . '=' . wfUrlencode( $value ); |
203 | 201 | } |
204 | 202 | |
205 | | - $this->response = file_get_contents( $str ); |
206 | | - if ( $this->response === false ) { |
| 203 | + $this->response = Http::get( $str ); |
| 204 | + if ( !$this->response ) { |
207 | 205 | return 'amazonplus-fgcerr'; |
208 | 206 | } |
209 | 207 | |