Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -320,7 +320,7 @@ |
321 | 321 | msg = msg.replace( '$2', $( '#mw-wikilove-title' ).val() ); // replace the title |
322 | 322 | var imageName = $( '#mw-wikilove-image' ).val(); |
323 | 323 | // if the image name doesn't start with a prefix, add one |
324 | | - if ( imageName.indexOf( 'File:' ) !== 0 && imageName.indexOf( 'Image:' ) !== 0 ) { |
| 324 | + if ( imageName.indexOf( 'File:' ) !== 0 && imageName.indexOf( 'Image:' ) !== 0 && imageName.indexOf( wgFormattedNamespaces[6] !== 0 ) ) { |
325 | 325 | imageName = 'File:' + imageName; |
326 | 326 | } |
327 | 327 | msg = msg.replace( '$3', imageName ); // replace the image |
— | — | @@ -446,7 +446,7 @@ |
447 | 447 | // get a random image from imageList and add it to the list of titles to be retrieved |
448 | 448 | var id = Math.floor( Math.random() * imageList.length ); |
449 | 449 | // make sure the image name has a prefix |
450 | | - if ( imageList[id].indexOf( 'File:' ) === 0 || imageList[id].indexOf( 'Image:' ) === 0 ) { |
| 450 | + if ( imageList[id].indexOf( 'File:' ) === 0 || imageList[id].indexOf( 'Image:' ) === 0 || imageList[id].indexOf( wgFormattedNamespaces[6] ) === 0) { |
451 | 451 | titles = titles + imageList[id] + '|'; |
452 | 452 | } else { |
453 | 453 | titles = titles + 'File:' + imageList[id] + '|'; |