Level 1
If this is server-side validation to detect the language of a post, then you could use a library like the ones discussed in these threads to detect the language and to return an error if the language is not Arabic:
Users would still be able to type non-Arabic text into the field on the client side, but it would prevent, for example, a user from posting comments in Japanese onto an Arabic website.
There could also be a character whitelist on the client and/or server-side, implemented similarly to what is discussed here:
1 like