mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
fix: polynomial regular expression used on uncontrolled data (#7083)
* fix: polynomial regular expression used on uncontrolled data * fix: optimize the function to handle both operations
This commit is contained in:
committed by
GitHub
parent
1fc3709731
commit
75a11ba31a
@@ -38,11 +38,10 @@ export const findTableAncestor = (node: Node | null): HTMLTableElement | null =>
|
||||
return node as HTMLTableElement;
|
||||
};
|
||||
|
||||
export const getTrimmedHTML = (html: string) => {
|
||||
html = html.replace(/^(<p><\/p>)+/, "");
|
||||
html = html.replace(/(<p><\/p>)+$/, "");
|
||||
return html;
|
||||
};
|
||||
export const getTrimmedHTML = (html: string) =>
|
||||
html
|
||||
.replace(/^(?:<p><\/p>)+/g, "") // Remove from beginning
|
||||
.replace(/(?:<p><\/p>)+$/g, ""); // Remove from end
|
||||
|
||||
export const isValidHttpUrl = (string: string): { isValid: boolean; url: string } => {
|
||||
// List of potentially dangerous protocols to block
|
||||
|
||||
Reference in New Issue
Block a user