fix: [REST client] Fixed the url parser for the client not handling named params

pull/3608/head
iglocska 2018-08-31 13:19:02 +02:00
parent 590f0ac1ea
commit a732cb4102
1 changed files with 2 additions and 8 deletions

View File

@ -1635,15 +1635,9 @@ class ServersController extends AppController
private function __doRestQuery($request)
{
App::uses('SyncTool', 'Tools');
$params = array(
);
$params = array();
if (!empty($request['url'])) {
$path = parse_url($request['url'], PHP_URL_PATH);
$query = parse_url($request['url'], PHP_URL_QUERY);
if (!empty($query)) {
$path .= '?' . $query;
}
$path = preg_replace('#^(://|[^/?])+#', '', $request['url']);
$url = Configure::read('MISP.baseurl') . '/' . $path;
} else {
throw new InvalidArgumentException('Url not set.');