Fix form element bug

This commit is contained in:
Dennis Eichhorn 2018-07-29 21:59:50 +02:00
parent 9f46c18967
commit 8409b5026f

View File

@ -51,16 +51,16 @@ if [[ "$FILE" =~ ^.+(tpl\.php|html)$ ]]; then
fi
# Input elements must have a type= attribute *error*
if [[ -n $(grep -P '(\<input)((?!.*?type=).)*(>)' $FILE) ]]; then
if [[ -n $(grep -P '(<input)((?!.*?type=).)*(>)' $FILE) ]]; then
echo -e "\e[1;31m\tFound missing input type attribute.\e[0m" >&2
grep -P '(\<input)((?!.*?type=).)*(>)' $FILE >&2
grep -P '(<input)((?!.*?type=).)*(>)' $FILE >&2
exit 1
fi
# Form fields must have a name *error*
if [[ -n $(grep -P '(\<input|select|textarea)((?!.*?name=).)*(>)' $FILE) ]]; then
if [[ -n $(grep -P '(<input|<select|<textarea)((?!.*?name=).)*(>)' $FILE) ]]; then
echo -e "\e[1;31m\tFound missing form element name.\e[0m" >&2
grep -P '(\<input|select|textarea)((?!.*?name=).)*(>)' $FILE >&2
grep -P '(<input|<select|<textarea)((?!.*?name=).)*(>)' $FILE >&2
exit 1
fi