Merge "Correct MWImage* resource regex to find literal .s rather than characters"

This commit is contained in:
jenkins-bot 2014-08-21 02:07:50 +00:00 committed by Gerrit Code Review
commit 0af7c2d634
2 changed files with 2 additions and 2 deletions

View file

@ -157,7 +157,7 @@ ve.dm.MWImageModel.static.createImageNode = function ( attributes, imageType ) {
*/
ve.dm.MWImageModel.static.newFromImageAttributes = function ( attrs, dir ) {
var imgModel = new ve.dm.MWImageModel( {
'resourceName': attrs.resource.replace( /^(.+\/)*/, '' ),
'resourceName': attrs.resource.replace( /^(\.+\/)*/, '' ),
'currentDimensions': {
'width': attrs.width,
'height': attrs.height

View file

@ -159,7 +159,7 @@ ve.dm.MWImageNode.prototype.onAttributeChange = function ( key, from, to ) {
ve.dm.MWImageNode.prototype.getFilename = function () {
// Strip ./ stuff and decode URI encoding
var resource = this.getAttribute( 'resource' ),
filename = resource.replace( /^(.+\/)*/, '' );
filename = resource.replace( /^(\.+\/)*/, '' );
// Protect against decodeURIComponent() throwing exceptions
try {