Skip to content

Commit 0fc67c3

Browse files
authored
Merge pull request #346 from cloudinary/fix/cld-folder-slash
Fix leading slash in cloudinary folder bug
2 parents e74d929 + 86d2a0a commit 0fc67c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

php/class-media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,8 @@ public function upload_dir( $dirs ) {
933933
*/
934934
public function get_cloudinary_folder() {
935935
$folder = '';
936-
if ( ! empty( $this->cloudinary_folder ) ) {
937-
$folder = trailingslashit( $this->cloudinary_folder );
936+
if ( ! empty( $this->cloudinary_folder ) && '/' !== $this->cloudinary_folder ) {
937+
$folder = trailingslashit( trim( $this->cloudinary_folder, '/' ) );
938938
}
939939

940940
return $folder;

0 commit comments

Comments
 (0)