Bugfix - Enforce URL length check in LinkMetadata before attempting to insert to database (#29589)

* Add missing URL length validation in LinkMetadata

* Added MaxURLLength constant

* Add test to validate new URL length limit

* Add comment about table constraint

* Use a seperate error string for URL length errors

* Added error string fpr URL length

* Updated error message

* Update en.json

* Fixed gofmt error in link_metadata.go

* use right txn id

```release-note
NONE
```

---------

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Nadav Tasher
2025-01-08 16:32:39 +02:00
коммит произвёл GitHub
родитель e6b4764e0d
Коммит baf9bf82c9
3 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@@ -9520,6 +9520,10 @@
"id": "model.link_metadata.is_valid.url.app_error",
"translation": "Link metadata URL must be set."
},
{
"id": "model.link_metadata.is_valid.url_length.app_error",
"translation": "Length of link metadata URL is {{ .Length }} characters long, which exceeds the maximum limit of {{ .MaxLength }} characters."
},
{
"id": "model.member.is_valid.channel.app_error",
"translation": "Channel name is not valid"