Skip to content

Commit 094952d

Browse files
author
Paolo Mainardi
committed
refs #81: Fix projects urlencode
1 parent ace0d6e commit 094952d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/Gitlab/Api/Projects.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function owned($page = 1, $per_page = self::PER_PAGE, $order_by = self::O
6060
*/
6161
public function search($query, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT)
6262
{
63-
return $this->get('projects/search/'.urlencode($query), array(
63+
return $this->get('projects/search/'.rawurlencode($query), array(
6464
'page' => $page,
6565
'per_page' => $per_page,
6666
'order_by' => $order_by,
@@ -74,7 +74,7 @@ public function search($query, $page = 1, $per_page = self::PER_PAGE, $order_by
7474
*/
7575
public function show($project_id)
7676
{
77-
return $this->get('projects/'.urlencode($project_id));
77+
return $this->get('projects/'.rawurlencode($project_id));
7878
}
7979

8080
/**
@@ -99,7 +99,7 @@ public function createForUser($user_id, $name, array $params = array())
9999
{
100100
$params['name'] = $name;
101101

102-
return $this->post('projects/user/'.urlencode($user_id), $params);
102+
return $this->post('projects/user/'.rawurlencode($user_id), $params);
103103
}
104104

105105
/**
@@ -109,7 +109,7 @@ public function createForUser($user_id, $name, array $params = array())
109109
*/
110110
public function update($project_id, array $params)
111111
{
112-
return $this->put('projects/'.urlencode($project_id), $params);
112+
return $this->put('projects/'.rawurlencode($project_id), $params);
113113
}
114114

115115
/**
@@ -118,7 +118,7 @@ public function update($project_id, array $params)
118118
*/
119119
public function remove($project_id)
120120
{
121-
return $this->delete('projects/'.urlencode($project_id));
121+
return $this->delete('projects/'.rawurlencode($project_id));
122122
}
123123

124124
/**
@@ -140,7 +140,7 @@ public function members($project_id, $username_query = null)
140140
*/
141141
public function member($project_id, $user_id)
142142
{
143-
return $this->get($this->getProjectPath($project_id, 'members/'.urlencode($user_id)));
143+
return $this->get($this->getProjectPath($project_id, 'members/'.rawurlencode($user_id)));
144144
}
145145

146146
/**
@@ -201,7 +201,7 @@ public function hooks($project_id, $page = 1, $per_page = self::PER_PAGE)
201201
*/
202202
public function hook($project_id, $hook_id)
203203
{
204-
return $this->get($this->getProjectPath($project_id, 'hooks/'.urlencode($hook_id)));
204+
return $this->get($this->getProjectPath($project_id, 'hooks/'.rawurlencode($hook_id)));
205205
}
206206

207207
/**
@@ -229,7 +229,7 @@ public function addHook($project_id, $url, array $params = array())
229229
*/
230230
public function updateHook($project_id, $hook_id, array $params)
231231
{
232-
return $this->put($this->getProjectPath($project_id, 'hooks/'.urlencode($hook_id)), $params);
232+
return $this->put($this->getProjectPath($project_id, 'hooks/'.rawurlencode($hook_id)), $params);
233233
}
234234

235235
/**
@@ -239,7 +239,7 @@ public function updateHook($project_id, $hook_id, array $params)
239239
*/
240240
public function removeHook($project_id, $hook_id)
241241
{
242-
return $this->delete($this->getProjectPath($project_id, 'hooks/'.urlencode($hook_id)));
242+
return $this->delete($this->getProjectPath($project_id, 'hooks/'.rawurlencode($hook_id)));
243243
}
244244

245245
/**
@@ -258,7 +258,7 @@ public function keys($project_id)
258258
*/
259259
public function key($project_id, $key_id)
260260
{
261-
return $this->get($this->getProjectPath($project_id, 'keys/'.urlencode($key_id)));
261+
return $this->get($this->getProjectPath($project_id, 'keys/'.rawurlencode($key_id)));
262262
}
263263

264264
/**
@@ -282,7 +282,7 @@ public function addKey($project_id, $title, $key)
282282
*/
283283
public function removeKey($project_id, $key_id)
284284
{
285-
return $this->delete($this->getProjectPath($project_id, 'keys/'.urlencode($key_id)));
285+
return $this->delete($this->getProjectPath($project_id, 'keys/'.rawurlencode($key_id)));
286286
}
287287

288288
/**
@@ -342,7 +342,7 @@ public function removeLabel($project_id, $name)
342342
*/
343343
public function createForkRelation($project_id, $forked_project_id)
344344
{
345-
return $this->post($this->getProjectPath($project_id, 'fork/'.urlencode($forked_project_id)));
345+
return $this->post($this->getProjectPath($project_id, 'fork/'.rawurlencode($forked_project_id)));
346346
}
347347

348348
/**
@@ -362,7 +362,7 @@ public function removeForkRelation($project_id)
362362
*/
363363
public function setService($project_id, $service_name, array $params = array())
364364
{
365-
return $this->put($this->getProjectPath($project_id, 'services/'.urlencode($service_name)), $params);
365+
return $this->put($this->getProjectPath($project_id, 'services/'.rawurlencode($service_name)), $params);
366366
}
367367

368368
/**
@@ -372,6 +372,6 @@ public function setService($project_id, $service_name, array $params = array())
372372
*/
373373
public function removeService($project_id, $service_name)
374374
{
375-
return $this->delete($this->getProjectPath($project_id, 'services/'.urlencode($service_name)));
375+
return $this->delete($this->getProjectPath($project_id, 'services/'.rawurlencode($service_name)));
376376
}
377377
}

0 commit comments

Comments
 (0)