From b44366467546c9effb3037575910f1645b97b1ec Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Tue, 16 May 2017 19:00:14 +0200 Subject: [PATCH] added checking for invalid characters in the identifier --- example-script/info.json | 2 +- run-tests.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/example-script/info.json b/example-script/info.json index dd3549e..ca48873 100644 --- a/example-script/info.json +++ b/example-script/info.json @@ -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'" diff --git a/run-tests.php b/run-tests.php index 2e50152..b8bf474 100755 --- a/run-tests.php +++ b/run-tests.php @@ -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"] == "") {