Index: trunk/extensions/ExternalData/ED_Utils.php |
— | — | @@ -276,7 +276,8 @@ |
277 | 277 | |
278 | 278 | static function fetchURL( $url, $post_vars = array(), $get_fresh=false, $try_count=1 ) { |
279 | 279 | $dbr = wfGetDB( DB_SLAVE ); |
280 | | - global $edgStringReplacements, $edgCacheTable, $edgCacheExpireTime; |
| 280 | + global $edgStringReplacements, $edgCacheTable, |
| 281 | + $edgCacheExpireTime, $edgAllowSSL; |
281 | 282 | |
282 | 283 | // do any special variable replacements in the URLs, for |
283 | 284 | // secret API keys and the like |
— | — | @@ -284,8 +285,13 @@ |
285 | 286 | $url = str_replace( $key, $value, $url ); |
286 | 287 | } |
287 | 288 | |
288 | | - if( !isset( $edgCacheTable ) || is_null( $edgCacheTable ) ) |
289 | | - return Http::get( $url ); |
| 289 | + if( !isset( $edgCacheTable ) || is_null( $edgCacheTable ) ) { |
| 290 | + if ($edgAllowSSL) { |
| 291 | + return Http::get( $url, 'default', array(CURLOPT_SSL_VERIFYPEER => false) ); |
| 292 | + } else { |
| 293 | + return Http::get( $url ); |
| 294 | + } |
| 295 | + } |
290 | 296 | |
291 | 297 | // check the cache (only the first 254 chars of the url) |
292 | 298 | $row = $dbr->selectRow( $edgCacheTable, '*', array( 'url' => substr($url,0,254) ), 'EDUtils::fetchURL' ); |
— | — | @@ -295,7 +301,11 @@ |
296 | 302 | } |
297 | 303 | |
298 | 304 | if ( !$row || $get_fresh) { |
299 | | - $page = Http::get( $url ); |
| 305 | + if ($edgAllowSSL) { |
| 306 | + $page = Http::get( $url, 'default', array(CURLOPT_SSL_VERIFYPEER => false) ); |
| 307 | + } else { |
| 308 | + $page = Http::get( $url ); |
| 309 | + } |
300 | 310 | if ( $page === false ) { |
301 | 311 | sleep( 1 ); |
302 | 312 | if( $try_count >= self::$http_number_of_tries ){ |