cd ~ || exit 1
echo "== début $(date '+%Y-%m-%d %H:%M')"
echo "== images contenant du code PHP"
find . -path ./hors-web-2026-10-06 -prune -o -path '*/var/cache' -prune -o -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.ico' \) -size -20k -print0 2>/dev/null | xargs -0 grep -l --binary-files=text -m1 '^<?php' 2>/dev/null | sed 's/^/PIÈGE /'
echo "== fichiers PHP qui chargent une image"
grep -rlE "include\s*\(?\s*['\"][^'\"]+\.(jpg|jpeg|png|gif|ico)['\"]" --include='*.php' --exclude-dir=hors-web-2026-10-06 . 2>/dev/null | grep -v /vendor/
echo "== fin $(date '+%Y-%m-%d %H:%M')"
