Skip to content

Commit

Permalink
Fixed regex in replaceElements (scureimage.js)
Browse files Browse the repository at this point in the history
The old regex replace the first parameter that end with ‘id’. The new
one use & or ? to catch exactly the ‘id’ param.
  • Loading branch information
gmthedoc committed Jul 12, 2016
1 parent a3decda commit c9496bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion securimage.js
Expand Up @@ -202,7 +202,7 @@ SecurimageAudio.prototype.replaceElements = function() {
var sourceEl = document.createElement('source');
this.copyElementAttributes(sourceEl, this.audioElement.children[c]);
var cid = (null !== this.captchaId) ? this.captchaId : (Math.random() + '').replace('0.', '');
sourceEl.src = sourceEl.src.replace(/id=[a-zA-Z0-9]+/, 'id=' + cid);
sourceEl.src = sourceEl.src.replace(/([?|&])id=[a-zA-Z0-9]+/, '$1id=' + cid);
newAudioEl.appendChild(sourceEl);
}

Expand Down

0 comments on commit c9496bb

Please sign in to comment.