From fb723778fb31dc6bb162b5de38789506e7fdb6c7 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 15 Jul 2009 07:53:39 -0400 Subject: [PATCH] add support for using curl if available --- classes/PluginWonderful.php | 10 +++++++++- plugin-wonderful.php | 2 +- readme.txt | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/classes/PluginWonderful.php b/classes/PluginWonderful.php index 8e926b6..b4589c4 100644 --- a/classes/PluginWonderful.php +++ b/classes/PluginWonderful.php @@ -18,7 +18,15 @@ class PluginWonderful { * Wrapper around file_get_contents for testing purposes. */ function _retrieve_url($url) { - return @file_get_contents($url); + if (extension_loaded('curl')) { + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); + $result = curl_exec($ch); + curl_close($ch); + return $result; + } else { + return @file_get_contents($url); + } } function _setup_actions() { diff --git a/plugin-wonderful.php b/plugin-wonderful.php index fd27cdf..cd126a2 100644 --- a/plugin-wonderful.php +++ b/plugin-wonderful.php @@ -3,7 +3,7 @@ Plugin Name: Plugin Wonderful Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Description: Easily embed a Project Wonderful publisher's advertisements. -Version: 0.5.1 +Version: 0.5.2 Author: John Bintz Author URI: http://www.coswellproductions.com/wordpress/ diff --git a/readme.txt b/readme.txt index 1b57995..d938e4f 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: johncoswell Tags: ads, sidebar, widget Requires at least: 2.7 Tested up to: 2.8 -Stable tag: 0.5.1 +Stable tag: 0.5.2 Donate link: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Plugin Wonderful lets Project Wonderful publishers quickly and easily add their adboxes to thier WordPress site.