From 9e8ca418fc4080eee03b1da48c53708244da6531 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 6 Feb 2012 17:53:14 +0100 Subject: [PATCH] Fixing URL check now we can accept URl with no www like http://youtube.com --- main/inc/ajax/link.ajax.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/inc/ajax/link.ajax.php b/main/inc/ajax/link.ajax.php index 931efa7e80..cf424d6457 100644 --- a/main/inc/ajax/link.ajax.php +++ b/main/inc/ajax/link.ajax.php @@ -20,11 +20,13 @@ switch ($action) { echo ''; exit; } + // set URL and other appropriate options $defaults = array( CURLOPT_URL => $url, + CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com CURLOPT_HEADER => 0, - CURLOPT_RETURNTRANSFER => TRUE, + CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 4 ); //create a new cURL resource @@ -38,7 +40,7 @@ switch ($action) { // close cURL resource, and free up system resources curl_close($ch); - if($result) { + if ($result) { echo Display::return_icon('accept.png', get_lang('Ok')); } else { echo Display::return_icon('wrong.gif', get_lang('Wrong'));