From 0198e5e6ba02bdcc8992bc2cd6028c80f24607f2 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 15 Jul 2009 08:06:33 -0400 Subject: [PATCH] use curl if it's available --- classes/DailyImageWidget.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/DailyImageWidget.php b/classes/DailyImageWidget.php index f9d17e9..72611db 100644 --- a/classes/DailyImageWidget.php +++ b/classes/DailyImageWidget.php @@ -50,7 +50,15 @@ class DailyImageWidget { } function _get_from_data_source() { - return @file_get_contents($this->data_source); + if (extension_loaded('curl')) { + $ch = curl_init($this->data_source); + curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); + $result = curl_exec($ch); + curl_close($ch); + return $result; + } else { + return @file_get_contents($this->data_source); + } } function _load_data() {