From b0a392b59c2f0028dfa0d9176e3585045abd8d5f Mon Sep 17 00:00:00 2001 From: pini-girit Date: Thu, 12 Aug 2021 11:18:27 +0300 Subject: [PATCH 1/2] v1.17.0: Improved URL encoding on JS video thumbnail generation --- view/adminhtml/web/js/cloudinary-media-library-modal.js | 4 ++-- view/adminhtml/web/js/get-video-information.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/view/adminhtml/web/js/cloudinary-media-library-modal.js b/view/adminhtml/web/js/cloudinary-media-library-modal.js index 3790c11..2377a50 100644 --- a/view/adminhtml/web/js/cloudinary-media-library-modal.js +++ b/view/adminhtml/web/js/cloudinary-media-library-modal.js @@ -115,7 +115,7 @@ define([ asset.asset_derived_image_url .replace(new RegExp('^.*cloudinary.com/(' + this.options.cloudinaryMLoptions.cloud_name + '/)?' + asset.resource_type + '/' + asset.type + '/'), '') .replace(/\.[^/.]+$/, '') - .replace(new RegExp('\/' + widget.escapeRegex(encodeURIComponent(asset.public_id)) + '$'), '') + .replace(new RegExp('\/' + widget.escapeRegex(encodeURI(asset.public_id)) + '$'), '') .replace(new RegExp('\/v[0-9]{1,10}$'), '') .replace(new RegExp('\/'), ','); if (widget.options.useDerived) { @@ -126,7 +126,7 @@ define([ asset.asset_image_url = asset.asset_url .replace(/\.[^/.]+$/, "") .replace(new RegExp('\/v[0-9]{1,10}\/'), '/') - .replace(new RegExp('\/(' + widget.escapeRegex(encodeURIComponent(asset.public_id)) + ')$'), '/so_auto/$1.jpg'); + .replace(new RegExp('\/(' + widget.escapeRegex(encodeURI(asset.public_id)) + ')$'), '/so_auto/$1.jpg'); } $.ajax({ url: widget.options.imageUploaderUrl, diff --git a/view/adminhtml/web/js/get-video-information.js b/view/adminhtml/web/js/get-video-information.js index e982301..9cee8d7 100644 --- a/view/adminhtml/web/js/get-video-information.js +++ b/view/adminhtml/web/js/get-video-information.js @@ -641,7 +641,7 @@ define( thumbnail = videoInfo.videoSrc .replace(/\.[^/.]+$/, "") .replace(new RegExp('\/v[0-9]{1,10}\/'), '/') - .replace(new RegExp('\/(' + this._escapeRegex(encodeURIComponent(tmp.public_id)) + ')$'), '/so_auto/$1.jpg'); + .replace(new RegExp('\/(' + this._escapeRegex(encodeURI(tmp.public_id)) + ')$'), '/so_auto/$1.jpg'); //Fallback for video thumbnail image, use placeholder or store logo $.ajax({ From b3e260d7c973d9e362cf1d1ac000c5c4b334dd27 Mon Sep 17 00:00:00 2001 From: pini-girit Date: Mon, 13 Sep 2021 11:46:15 +0300 Subject: [PATCH 2/2] Bounced version to 1.16.1 [hotfix for JS encoding on video thumbnail generation] --- composer.json | 2 +- etc/module.xml | 2 +- marketplace.composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 1cf35de..cb537ae 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "cloudinary/cloudinary-magento2", "description": "Cloudinary Magento 2 Integration.", "type": "magento2-module", - "version": "1.16.0", + "version": "1.16.1", "license": "MIT", "require": { "cloudinary/cloudinary_php": "^1.20.0" diff --git a/etc/module.xml b/etc/module.xml index 2b43632..9f63733 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - + diff --git a/marketplace.composer.json b/marketplace.composer.json index a9c687e..7f77c21 100644 --- a/marketplace.composer.json +++ b/marketplace.composer.json @@ -2,7 +2,7 @@ "name": "cloudinary/cloudinary", "description": "Cloudinary Magento 2 Integration.", "type": "magento2-module", - "version": "1.16.0", + "version": "1.16.1", "license": "MIT", "require": { "cloudinary/cloudinary_php": "^1.20.0"