mirror of
https://github.com/cross-lfs/clfs-embedded.git
synced 2025-08-15 22:01:47 +00:00
Don't obfuscate emails
The only ones present are for the license. These are already published all over the place, so there's no need to add obfuscation.
This commit is contained in:
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# obfuscate.sh
|
||||
# obfuscate email addresses in XML/HTML
|
||||
# Script written (and slight perl modification) by Archaic <archaic AT linuxfromscratch D0T org>
|
||||
# Modified from "sed -i" to old style "sed -e" by Manuel Canales <manuel AT linuxfromscratch D0T org>
|
||||
# to prevent hangs on very long files, like nonckunked books.
|
||||
# Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org>
|
||||
# Released under the GNU General Public License
|
||||
#
|
||||
# This script currently only seeks out mailto: addresses. If those same
|
||||
# addresses also appear in plaintext, we need to obfuscate those as well.
|
||||
#
|
||||
# This script was made for a very specific purpose so I was a bit lazy in
|
||||
# writing the regex's.
|
||||
#
|
||||
# Please send comments, enhancements, etc. to the above address
|
||||
|
||||
#set -e # Bail on all errors
|
||||
|
||||
# First, ensure that we are given a file to process
|
||||
# if [ $# -lt 1 ]; then
|
||||
# echo -e "\nYou must provide an input file."
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
# Nothing like a backup plan!
|
||||
#cp "$1" "$1".bak
|
||||
|
||||
for i in `grep -o '"mailto:.*@.*"' ${1} |sed -e 's|^"mailto:||' -e 's|"$||'`; do
|
||||
link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'`
|
||||
plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'`
|
||||
cp ${1}{,.tmp}
|
||||
sed -e "s|mailto:$i|mailto:$link|" \
|
||||
-e "s|$i|$plaintext|" ${1}.tmp > ${1}
|
||||
rm ${1}.tmp
|
||||
done
|
||||
#rm $FILE.tmp
|
||||
#exit 0
|
@ -11,12 +11,10 @@ TOP=`dirname $0`
|
||||
if test -d "$1"; then
|
||||
find "$1" -type f -name \*.html | while read file; do
|
||||
tidy -config "${TOP}/tidy.conf" "$file"
|
||||
bash "${TOP}/obfuscate.sh" "$file"
|
||||
sed -i -e "s@text/html@application/xhtml+xml@g" "$file"
|
||||
done
|
||||
else
|
||||
tidy -config "${TOP}/tidy.conf" "$1"
|
||||
bash "${TOP}/obfuscate.sh" "$1"
|
||||
sed -i -e "s@text/html@application/xhtml+xml@g" "$1"
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user