mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-22 07:58:08 +00:00
added checking for invalid characters in the identifier
This commit is contained in:
parent
2b7735ff59
commit
b443664675
2 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Example script",
|
||||
"identifier": "example-script",
|
||||
"identifier": "example-scriptX",
|
||||
"script": "example-script.qml",
|
||||
"version": "0.0.1",
|
||||
"description" : "Use this script to start a new script you want to submit to the script repository.\\n\\nJust copy the whole 'example-script' folder and rename it and also the 'example-script.qml'"
|
||||
|
|
|
@ -39,8 +39,11 @@ class TestHelper {
|
|||
$errors[] = "No name was entered!";
|
||||
}
|
||||
|
||||
if ($data["identifier"] == "") {
|
||||
$identifier = $data["identifier"];
|
||||
if ($identifier == "") {
|
||||
$errors[] = "No identifier was entered!";
|
||||
} elseif (preg_match('/[^a-z0-9]/', $str)) {
|
||||
$errors[] = "Invalid charactes were found in identifier '$identifier'!";
|
||||
}
|
||||
|
||||
if ($data["description"] == "") {
|
||||
|
|
Loading…
Reference in a new issue