wordpress-theme-openmamba/cgi-bin/text-to-html-filter.cgi

25 lines
887 B
Plaintext
Raw Normal View History

#!/bin/bash
echo $header
ext=${file/*.}
range=10000
filename="/var/www/www.openmamba.org/$file"
filename_check=`readlink -f $filename`
[ "${filename_check:0:22}" = "/var/ftp/pub/openmamba" ] || exit 0
if [ "$page" ]; then
[ $page -gt 0 ] || page=1
else
page=1
fi
from=`expr \( $page - 1 \) \* $range + 1`
to=`expr $from \+ $range - 1`
if [ "$ext" = "log" -o "$ext" = "spec" -o "$ext" = "patch" -o "$ext" = "diff" ]; then
/bin/sed -n "${from},${to}p" $filename | /bin/sed -e 's|\&|\&|g' \
-e 's|<|\&lt;|g' \
-e 's|>|\&gt;|g' \
-e 's|\([[:alpha:][:digit:]]*\)\@[[:alpha:][:digit:]]*\.[[:alpha:][:digit:]\.]*|\1@...|g'
#'s|\&|\\&amp;|g' -e 's|<|\&lt;|g' -e 's|>|\&gt;|g' -e 's|\([[:alpha:][:digit:]]*\)\@[[:alpha:][:digit:]]*\.[[:alpha:][:digit:]\.]*|\1@...|g' /var/www/www.openmamba.org/$file
else
/bin/sed -n "${from},${to}p" $filename
fi
exit 0