Fix bug where empty attributes are not checked

This commit is contained in:
Dennis Eichhorn 2018-07-12 22:34:54 +02:00
parent a523c9968f
commit a0c0b838db
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ fi
if [[ "$FILE" =~ ^.+(tpl\.php|html)$ ]]; then
if [[ -n $(grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]+\"' $FILE) ]]; then
echo -e "\e[1;31m\tFound invalid attribute.\e[0m" >&2
grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]+\"' $FILE >&2
grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]*\"' $FILE >&2
exit 1
fi

View File

@ -5,6 +5,6 @@
echo "Start html attributes inspection"
# Find invalid attributes
find ${ROOT_PATH} -name "*tpl.php" | xargs grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]+\"' > ${INSPECTION_PATH}/Modules/html/attributes_invalid.log
find ${ROOT_PATH} -name "*tpl.php" | xargs grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]*\"' > ${INSPECTION_PATH}/Modules/html/attributes_invalid.log
find ${ROOT_PATH} -name "*tpl.php" | xargs grep -E '(id|class)=\"[a-zA-Z]*[\#\$\%\^\&\*\(\)\\/\ ]+[a-zA-Z]*\"' >> ${INSPECTION_PATH}/Modules/html/attributes_invalid.log
find ${ROOT_PATH} -name "*tpl.php" | xargs grep -P '(\<img)((?!.*?alt=).)*(>)' >> ${INSPECTION_PATH}/Modules/html/attributes_invalid.log