Commit 2283a2f385d4a81081864ffb4c4c1bc813d85abe
1 parent
99b5098c
Exists in
master
Encode dynamic URLs
Showing
2 changed files
with
4 additions
and
5 deletions
Show diff stats
view/js/corretor.js
... | ... | @@ -254,7 +254,7 @@ |
254 | 254 | $('#submission-date').text( |
255 | 255 | moment(task.info.submission_date).format('DD/MM/YYYY')); |
256 | 256 | $('#ref-video').html(videoHelper.getSource(baseRefVidUrl)); |
257 | - $('#ref-video-link').attr('href', refVidUrl); | |
257 | + $('#ref-video-link').attr('href', encodeURI(refVidUrl)); | |
258 | 258 | |
259 | 259 | var lastAnswer = task.info.last_answer; |
260 | 260 | var hasLastAnswer = typeof lastAnswer != 'undefined'; |
... | ... | @@ -270,7 +270,7 @@ |
270 | 270 | $('#number-of-fixes').text(lastAnswer.number_of_fixes); |
271 | 271 | _showApprovalGUI(task, deferred); |
272 | 272 | } |
273 | - $('#blend-link').attr('href', blendLink); | |
273 | + $('#blend-link').attr('href', encodeURI(blendLink)); | |
274 | 274 | $('#avatar-video').html(videoHelper.getSource(baseAvatarVidUrl)); |
275 | 275 | } |
276 | 276 | ... | ... |
view/js/helpers/video-helper.js
1 | 1 | (function(videoHelper, $, undefined) { |
2 | 2 | |
3 | 3 | function _getSource(videoBaseUrl) { |
4 | - return '<source src="' + videoBaseUrl + '.webm" type="video/webm">' | |
5 | - + '<source src="' + videoBaseUrl | |
6 | - + '.mp4" type="video/mp4">Sem suporte a vídeos'; | |
4 | + return '<source src="' + encodeURI(videoBaseUrl + '.webm') + '" type="video/webm">' | |
5 | + + '<source src="' + encodeURI(videoBaseUrl + '.mp4') + '" type="video/mp4">Sem suporte a vídeos'; | |
7 | 6 | } |
8 | 7 | |
9 | 8 | function _controlVideo(elId, toPlay) { | ... | ... |