diff --git a/0.3/functions.php b/0.3/functions.php index 8073e9d..2aacef1 100755 --- a/0.3/functions.php +++ b/0.3/functions.php @@ -22,14 +22,14 @@ function DetectRedirect($url) { if(parse_url($url, PHP_URL_HOST)==FALSE) { //die('Not a URL'); - return array( 'error' => 'Not a URL: '. escape ($url) ); + throw new Exception('Not a URL: '. escape ($url) ); } $response = get_headers($url, 1); if(!empty($response['Location'])) { $response2 = get_headers($response['Location'], 1); if(!empty($response2['Location'])) { //die('too much redirection'); - return array( 'error' => 'too much redirection: '. escape ($url) ); + throw new Exception('too much redirection: '. escape ($url) ); } else { return $response['Location']; } }