From ce8524b247460f0cd1dc89fd01523579b801f494 Mon Sep 17 00:00:00 2001 From: smilerz Date: Thu, 18 Mar 2021 16:03:13 -0500 Subject: [PATCH] added data validation on name and description length --- cookbook/templates/url_import.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cookbook/templates/url_import.html b/cookbook/templates/url_import.html index fdbf331e2..c21160088 100644 --- a/cookbook/templates/url_import.html +++ b/cookbook/templates/url_import.html @@ -357,6 +357,14 @@ }) }, importRecipe: function () { + if (this.recipe_data.name.length > 128) { + this.makeToast(gettext('Error'), gettext('Recipe name is longer than 128 characters'), 'danger') + return; + } + if (this.recipe_data.description.length > 512) { + this.makeToast(gettext('Error'), gettext('Recipe description is longer than 512 characters'), 'danger') + return; + } if (this.importing_recipe) { this.makeToast(gettext('Error'), gettext('Already importing the selected recipe, please wait!'), 'danger') return;