Skip to content

Commit

Permalink
Fix small bug in image2 plugin
Browse files Browse the repository at this point in the history
  * Fix missing check of the query string presence in the src of the
    image before adding a random query string value for cache purpose
  * fixes ckeditor#3394
  • Loading branch information
surli committed Apr 8, 2022
1 parent 3566f47 commit bcd3aab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/image2/dialogs/image2.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ CKEDITOR.dialog.add( 'image2', function( editor ) {
addListener( 'abort', function() {
callback( null );
} );


var queryStringSeparator = (src.indexOf('?') > -1) ? '&' : '?';
image.setAttribute( 'src',
( config.baseHref || '' ) + src + '?' + Math.random().toString( 16 ).substring( 2 ) );
( config.baseHref || '' ) + src + queryStringSeparator + Math.random().toString( 16 ).substring( 2 ) );
};
}

Expand Down

0 comments on commit bcd3aab

Please sign in to comment.