From a8f7893defa1546c004f148265e6f6cc393ce9cb Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Sat, 20 Oct 2018 16:14:59 +0200 Subject: [PATCH] Fix #470: Properly encode Wikipedia and lyrics search urls --- changes/changelog.d/470.bugfix | 1 + front/src/components/library/Album.vue | 2 +- front/src/components/library/Artist.vue | 2 +- front/src/components/library/Track.vue | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changes/changelog.d/470.bugfix diff --git a/changes/changelog.d/470.bugfix b/changes/changelog.d/470.bugfix new file mode 100644 index 000000000..f26c4ddc3 --- /dev/null +++ b/changes/changelog.d/470.bugfix @@ -0,0 +1 @@ +Properly encode Wikipedia and lyrics search urls (#470) diff --git a/front/src/components/library/Album.vue b/front/src/components/library/Album.vue index 03d83e064..8956d14cc 100644 --- a/front/src/components/library/Album.vue +++ b/front/src/components/library/Album.vue @@ -102,7 +102,7 @@ export default { } }, wikipediaUrl () { - return 'https://en.wikipedia.org/w/index.php?search=' + this.album.title + ' ' + this.album.artist.name + return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.album.title + ' ' + this.album.artist.name) }, musicbrainzUrl () { return 'https://musicbrainz.org/release/' + this.album.mbid diff --git a/front/src/components/library/Artist.vue b/front/src/components/library/Artist.vue index fe74f6f17..387596be1 100644 --- a/front/src/components/library/Artist.vue +++ b/front/src/components/library/Artist.vue @@ -151,7 +151,7 @@ export default { }).length > 0 }, wikipediaUrl () { - return 'https://en.wikipedia.org/w/index.php?search=' + this.artist.name + return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.artist.name) }, musicbrainzUrl () { return 'https://musicbrainz.org/artist/' + this.artist.mbid diff --git a/front/src/components/library/Track.vue b/front/src/components/library/Track.vue index 75d5f650d..040d3a466 100644 --- a/front/src/components/library/Track.vue +++ b/front/src/components/library/Track.vue @@ -196,7 +196,7 @@ export default { } }, wikipediaUrl () { - return 'https://en.wikipedia.org/w/index.php?search=' + this.track.title + ' ' + this.track.artist.name + return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.track.title + ' ' + this.track.artist.name) }, musicbrainzUrl () { return 'https://musicbrainz.org/recording/' + this.track.mbid @@ -211,7 +211,7 @@ export default { lyricsSearchUrl () { let base = 'http://lyrics.wikia.com/wiki/Special:Search?query=' let query = this.track.artist.name + ' ' + this.track.title - return base + query + return base + encodeURI(query) }, cover () { return null