The commit SHA is not valid. It should respect this pattern
[a-fA-Z0-9]{6,}.
@@ -236,14 +236,22 @@
ng-model-options="{ debounce: 250 }"
ng-class="{'is-invalid': anonymize.terms.$invalid}"
>
- One term per line. Each term will be replaced by XXX.
+ One term per line. A term is a RegEx! Each term will be replaced
+ by {{site_options.ANONYMIZATION_MASK}}-[Line Number].
+
+
+ We identify that you are using some regex characters, if it was
+ not on purpose, please escape them.
+
- Terms are in an invalid format
+ Terms are in an invalid format.
@@ -332,7 +340,7 @@
- Keep or remove all the links.
@@ -347,7 +355,7 @@
- Images are not anonymized
@@ -362,7 +370,7 @@
- PDF are not anonymized
@@ -415,7 +423,7 @@
- Enable anonymized Github pages. It currently only
supported for Github pages that are defined in the
same branch. It will be available at
diff --git a/public/script/app.js b/public/script/app.js
index 23d6f25..3e3406e 100644
--- a/public/script/app.js
+++ b/public/script/app.js
@@ -1231,6 +1231,14 @@ angular
}
function anonymize() {
+ $scope.anonymize.terms.$setValidity("regex", true);
+ // check if string has regex characters
+ if (
+ $scope.terms &&
+ $scope.terms.match(/[-[\]{}()*+?.,\\^$|#\s]/g)
+ ) {
+ $scope.anonymize.terms.$setValidity("regex", false);
+ }
const urlRegex =
/\b((https?|ftp|file):\/\/)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]\b\/?>?/g;
let content = $scope.readme;
@@ -1304,7 +1312,7 @@ angular
$scope.anonymize.repoUrl.$setValidity("access", true);
$scope.anonymize.conference.$setValidity("activated", true);
$scope.anonymize.terms.$setValidity("format", true);
- $scope.anonymize.terms.$setValidity("format", true);
+ $scope.anonymize.terms.$setValidity("regex", true);
}
function displayErrorMessage(message) {