Allow to ommit form action/method

This commit is contained in:
Dennis Eichhorn 2018-08-25 19:23:34 +02:00
parent c98ec7517d
commit c9d0550d4c
3 changed files with 5 additions and 5 deletions

View File

@ -102,8 +102,8 @@ git diff --cached --name-only | while read FILE; do
fi
if [[ $TPL_SYNTAX = 4 ]]; then
echo -e "\e[1;31m\tFound missing form element action, method or id.\e[0m" >&2
grep -P '(\<form)((?!.*?(action|method|id)=).)*(>)' "$FILE" >&2
echo -e "\e[1;31m\tFound missing form element name or id.\e[0m" >&2
grep -P '(\<form)((?!.*?(name|id)=).)*(>)' "$FILE" >&2
exit 1
fi

View File

@ -39,7 +39,7 @@ hasInvalidHtmlTemplateContent() {
fi
# Form must have a id, action and method *error*
if [[ -n $(grep -P '(\<form)((?!.*?(action|method|id)=).)*(>)' "$1") ]]; then
if [[ -n $(grep -P '(\<form)((?!.*?(name|id)=).)*(>)' "$1") ]]; then
return 4
fi

View File

@ -104,8 +104,8 @@ git diff --name-only $TRAVIS_COMMIT_RANGE | while read FILE; do
fi
if [[ $TPL_SYNTAX = 4 ]]; then
echo -e "\e[1;31m\tFound missing form element action, method or id.\e[0m" >&2
grep -P '(\<form)((?!.*?(action|method|id)=).)*(>)' "$FILE" >&2
echo -e "\e[1;31m\tFound missing form element name or id.\e[0m" >&2
grep -P '(\<form)((?!.*?(name|id)=).)*(>)' "$FILE" >&2
exit 1
fi