mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-08-03 21:13:45 +00:00
wipfix(i18n): make sure to check for string
Likely introdued in https://github.com/PrivateBin/PrivateBin/pull/1730
This commit is contained in:
parent
393eb070e9
commit
38baa8edbe
1 changed files with 5 additions and 3 deletions
|
|
@ -943,18 +943,20 @@ window.PrivateBin = (function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* Check if string contains valid HTML code
|
||||
* Check if string contains valid HTML code.
|
||||
*
|
||||
* If it is no string at all, this always returns false for compatibility.
|
||||
*
|
||||
* @name I18n.isStringContainsHtml
|
||||
* @function
|
||||
* @private
|
||||
* @param {string} messageId
|
||||
* @param {string|object} messageId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isStringContainsHtml(messageId) {
|
||||
// message IDs are allowed to contain anchors, spans, keyboard and emphasis tags
|
||||
// we can recognize all of them by only checking for anchors and keyboard tags
|
||||
return messageId.indexOf('<a') !== -1 || messageId.indexOf('<kbd') !== -1;
|
||||
return typeof messageId === 'string' && (messageId.indexOf('<a') !== -1 || messageId.indexOf('<kbd') !== -1);
|
||||
}
|
||||
|
||||
return me;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue