From 227eefa332c15531bd279ba1a4cafee11f13715d Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 25 Aug 2016 14:54:38 +0100 Subject: [PATCH] Can pass text as 3rd param now for die message --- lib/settings-common.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/settings-common.php b/lib/settings-common.php index bd401c6..ac796d5 100644 --- a/lib/settings-common.php +++ b/lib/settings-common.php @@ -46,7 +46,7 @@ if (isset($_SESSION['text'])) { } // Get data from a fopen or CURL connection -function getData($url,$type='fopen',$shouldDie=false) { +function getData($url,$type='fopen',$dieMessage=false) { global $context; // Request is to connect via CURL @@ -70,11 +70,11 @@ function getData($url,$type='fopen',$shouldDie=false) { $data = @file_get_contents(str_replace("https:","http:",$url), false, $context); } } - // Return data or die + // Return data or die with message if ($data) { return $data; - } elseif ($shouldDie) { - die('Unable to get data over a fopen or CURL connection'); + } elseif ($dieMessage) { + die($dieMessage); exit; } }