Remove any slashed at the start of the method

This commit is contained in:
Mark Schouten 2014-06-30 13:12:42 +02:00
parent aa37139301
commit a87e23947e

View file

@ -15,6 +15,7 @@ header("Content-Type: application/json");
function _do_curl($method, $opts = null, $type = 'post') {
global $apisid, $apiuser, $apipass, $apiip, $apiport;
$method = preg_replace('/:serverid:/', $apisid, $method);
$method = preg_replace('/^\/+//', '', $method);
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, "$apiuser:$apipass");