1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 08:35:17 +00:00

Can create text posts

This commit is contained in:
2020-01-04 17:06:43 +01:00
parent a726ba4230
commit 037916e7eb
4 changed files with 127 additions and 5 deletions

View File

@ -85,9 +85,10 @@ export class RequestHandler {
* Get some content for post and satinize it (remove HTML nodes)
*
* @param name The name of the POST field
* @param minLength Optionnal minimal length for the post
*/
public postContent(name: string) : string {
const content = this.postString(name);
public postContent(name: string, minLength ?: number) : string {
const content = this.postString(name, minLength);
if(content.match(/data:image/))
this.error(401, "Please do not include inline images!");