Commit 31d3b1e7 authored by Xavier Guimard's avatar Xavier Guimard

Improvement in regex (#1431)

parent 783349a3
......@@ -60,7 +60,7 @@ setOrder = ->
# Function used to remove an OIDC consent
removeOidcConsent = (partner) ->
r = new RegExp "\b#{partner}\b,?"
r = new RegExp "\b#{partner}\b,?", 'g'
datas['oidcConsents'] = datas['oidcConsents'].replace(r,'').replace(/,$/,'')
setKey '_oidcConnectedRP', datas['oidcConsents']
# Success
......
......@@ -76,7 +76,7 @@ LemonLDAP::NG Portal jQuery scripts
removeOidcConsent = function(partner) {
var r;
r = new RegExp("\b" + partner + "\b,?");
r = new RegExp("\b" + partner + "\b,?", 'g');
datas['oidcConsents'] = datas['oidcConsents'].replace(r, '').replace(/,$/, '');
return setKey('_oidcConnectedRP', datas['oidcConsents'], function() {
return $("[partner='" + partner + "']").hide();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment