Mwjames has submitted this change and it was merged. Change subject: Add support for apostrophes in titles ......................................................................
Add support for apostrophes in titles The href attribute is urlencoded, so (for example) apostrophes appear as %27. This causes the API request to contain the percent-encoded name instead of the the actual file name; thus, the API request fails and the overlay will not work. To fix this, decode the title from the URL first to get a valid title representation for the API. Change-Id: I00f96c9c870b878ca25792a878f3ceb7e9aefacc --- M formats/gallery/resources/ext.srf.gallery.overlay.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mwjames: Verified; Looks good to me, approved diff --git a/formats/gallery/resources/ext.srf.gallery.overlay.js b/formats/gallery/resources/ext.srf.gallery.overlay.js index 430cb34..b9b21ae 100644 --- a/formats/gallery/resources/ext.srf.gallery.overlay.js +++ b/formats/gallery/resources/ext.srf.gallery.overlay.js @@ -104,7 +104,7 @@ util.spinner.create( { context: $this, selector: 'img' } ); // Re-assign image url - util.getImageURL( { 'title': ns + ':' + title[1] }, + util.getImageURL( { 'title': ns + ':' + decodeURIComponent( title[1] ) }, function( url ) { if ( url === false ) { image.attr( 'href', '' ); // Release thumb image -- To view, visit https://gerrit.wikimedia.org/r/164894 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00f96c9c870b878ca25792a878f3ceb7e9aefacc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticResultFormats Gerrit-Branch: master Gerrit-Owner: Poke <patrickwesterh...@gmail.com> Gerrit-Reviewer: Foxtrott <s7ep...@gmail.com> Gerrit-Reviewer: Mwjames <jamesin.hongkon...@gmail.com> Gerrit-Reviewer: Poke <patrickwesterh...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits