diff --git a/xpfe/global/resources/content/commonDialog.js b/xpfe/global/resources/content/commonDialog.js index 49fb1ab6b20..c14b91d5fe8 100644 --- a/xpfe/global/resources/content/commonDialog.js +++ b/xpfe/global/resources/content/commonDialog.js @@ -71,7 +71,7 @@ function setLabelForNode(aNode, aLabel, aIsLabelFlag) { // This is for labels with possible accesskeys var accessKeyIndex; - if (aLabel.charAt(0) == '&') { + if (/^\&[^\&]/.test(aLabel)) { // access key is at the start accessKeyIndex = 0; } else { accessKeyIndex = aLabel.search(/[^\&]\&[^\&]/) + 1; @@ -88,7 +88,7 @@ function setLabelForNode(aNode, aLabel, aIsLabelFlag) aLabel = aLabel.substr(0, accessKeyIndex) + aLabel.substr(accessKeyIndex + 1); } - aLabel = aLabel.replace(/\&\&/, "&"); + aLabel = aLabel.replace(/\&\&/g, "&"); if (aIsLabelFlag) { // Set text for