mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 16:45:16 +00:00
Add support for YouTube posts
This commit is contained in:
@ -57,4 +57,22 @@ export function removeHTMLNodes(input : string) : string {
|
||||
*/
|
||||
export function check_string_before_insert(s: string) : boolean {
|
||||
return s.trim().length >= 3;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check the validity of a YouTube ID
|
||||
*
|
||||
* @param s The id to check
|
||||
*/
|
||||
export function check_youtube_id(s: string) : boolean {
|
||||
return s.length >= 5
|
||||
&& !s.includes("/")
|
||||
&& !s.includes("\\")
|
||||
&& !s.includes("@")
|
||||
&& !s.includes("&")
|
||||
&& !s.includes("?")
|
||||
&& !s.includes(".")
|
||||
&& !s.includes("'")
|
||||
&& !s.includes("\"")
|
||||
}
|
Reference in New Issue
Block a user