From 658ddef8227de0976dfecc60b29217de3189c636 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Thu, 14 Jun 2012 14:25:33 +0200 Subject: [PATCH] Move de-arraying out of retrieveURLasync. --- ykval-common.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ykval-common.php b/ykval-common.php index 50bb2e0..59b9bca 100644 --- a/ykval-common.php +++ b/ykval-common.php @@ -166,8 +166,7 @@ function retrieveURLasync ($urls, $ans_req=1, $match="^OK", $returl=False) { } curl_multi_close ($mh); - if ($ans_count==1) return $ans_arr[0]; - else return $ans_arr; + return $ans_arr; } curl_multi_remove_handle ($mh, $info['handle']); @@ -205,7 +204,10 @@ function KSMdecryptOTP($urls) { } elseif (count($urls) == 1) { $response = retrieveURLsimple ($urls[0]); } else { - $response = retrieveURLasync ($urls); + $response = retrieveURLasync ($urls, $ans_req=1, $match="^OK", $returl=False); + if (is_array($response)) { + $response = $response[0]; + } } if ($response) { debug("YK-KSM response: " . $response);