Skip to content

Commit

Permalink
v1.17.0: Improved URL encoding on JS video thumbnail generation
Browse files Browse the repository at this point in the history
  • Loading branch information
pini-girit committed Sep 13, 2021
1 parent 8ee2420 commit b0a392b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions view/adminhtml/web/js/cloudinary-media-library-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/web/js/get-video-information.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit b0a392b

Please sign in to comment.