V8 API restriction of characters in requests

I’ve been trying to update email addresses using a PATCH request as per the API (https://deploy-preview-90–suitedocs.netlify.com/developer/api/version-8/json-api-new/#_update_a_module_record), but came across a 400 error: “errors”: { “status”: 400, “title”: null, “detail”: “The option “attributes” with value array is invalid.”

After a few tests, I found my issue was due to the @ and . (full-stop) characters being blocked.

I’ve tracked this down to REGEX_FIELD_PATTERN in \Api\V8\Param\Options\Fields.php - line 10.

The REGEX_FIELD_PATTERN is very restrictive by default (I presume the intention was to stop rogue characters getting into the DB), but is too restrictive to allow changes to basic fields like email address.

Please can the REGEX_FIELD_PATTERN be changed by default from:
const REGEX_FIELD_PATTERN = ‘/[^\w-,]/’;
to
const REGEX_FIELD_PATTERN = ‘/[^\w !#$%&’*±=?^_`{|}~@.[]]/’;

This will allow a few more characters to be usable.

Someone already reported this on Github:

https://github.com/salesagility/SuiteCRM/issues/6452

then a fix was proposed, using a slightly different Regexp, you can see it there.

Thanks for the quick reply! Good to see this has already been identified and is on the roadmap.