Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
escape data in calendar popover (#2960)
- Loading branch information
1 parent
89bfa82
commit 9470699
Showing
9 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* This file is part of the Kimai time-tracking app. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/*! | ||
* [KIMAI] KimaiEscape: sanitize strings | ||
*/ | ||
|
||
import KimaiPlugin from "../KimaiPlugin"; | ||
|
||
export default class KimaiEscape extends KimaiPlugin { | ||
|
||
getId() { | ||
return 'escape'; | ||
} | ||
|
||
/** | ||
* @param {string} title | ||
* @returns {string} | ||
*/ | ||
escapeForHtml(title) { | ||
const tagsToReplace = { | ||
'&': '&', | ||
'<': '<', | ||
'>': '>', | ||
}; | ||
|
||
return title.replace(/[&<>]/g, function(tag) { | ||
return tagsToReplace[tag] || tag; | ||
}); | ||
}; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters