Skip to content

Commit 96ef088

Browse files
committed
NGSTACK-543 improve resource id urlencoding
Fix regression introduced in 2.0.0-alpha4: 2.0.0-alpha3...2.0.0-alpha4
1 parent 03deacd commit 96ef088

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bundle/RemoteMedia/Provider/Cloudinary/Gateway/CloudinaryApiGateway.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,13 @@ public function countResourcesInFolder($folder)
264264
public function get($id, $type)
265265
{
266266
try {
267-
return (array) $this->cloudinaryApi->resource(urlencode($id), ['resource_type' => $type]);
267+
$id = array_map(function (string $part) {
268+
return urlencode($part);
269+
}, explode('/', $id));
270+
271+
$id = implode('/', $id);
272+
273+
return (array) $this->cloudinaryApi->resource($id, ['resource_type' => $type]);
268274
} catch (Cloudinary\Error $e) {
269275
return [];
270276
}

0 commit comments

Comments
 (0)