Open robbieaverill opened 5 years ago
Validation rules from SSP:
if (preg_match('/[^a-zA-Z0-9]/', $this->Name)) {
$result->error('"name" contains invalid characters, only a-z, A-Z, 0-9 permitted');
}
if (preg_match('/[^a-zA-Z0-9\/\-_:\.]/', $this->Image)) {
$result->error('"image" contains invalid characters, only a-z, A-Z, 0-9, slash, dash, underscore, colon and full stop permitted');
}
This same SSP API restriction is seen with the CWP demos: https://github.com/silverstripeltd/cwp-demo/issues/18
The SSP API returns an error response if you use anything other than
[a-zA-Z0-9]
in the site name. We can validate this pattern early in theinstantiate
command to prevent API errors coming back.https://platform.playpen.pl/static/internal.html#demos-demos-collection-post - see "project_id" param. The input requirements are not documented at this stage.