webbuild: implement a var2html function to filter for security variable to html
Currently used in chat messages
This commit is contained in:
parent
aca1323856
commit
77ecc7566d
@ -980,8 +980,7 @@ if [ "$REQUEST" = "changespec" ]; then
|
|||||||
REQUEST="edit";
|
REQUEST="edit";
|
||||||
fi
|
fi
|
||||||
elif [ "$REQUEST" = "broadcastmessage" ]; then
|
elif [ "$REQUEST" = "broadcastmessage" ]; then
|
||||||
BROADCASTMESSAGE=`echo $BROADCASTMESSAGE | sed "s|<|\<|g"`
|
social_log "SUSER=$USER STYPE=broadcastmessage SEMAIL=$USER_EMAIL STEXT=\"said:"<i>`var2html BROADCASTMESSAGE`</i>"\" STIME=`date +%s`"
|
||||||
social_log "SUSER=$USER STYPE=broadcastmessage SEMAIL=$USER_EMAIL STEXT=\"said:"<i>$BROADCASTMESSAGE</i>"\" STIME=`date +%s`"
|
|
||||||
REQUEST=
|
REQUEST=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -179,6 +179,20 @@ function cgi_getvars()
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function var2html()
|
||||||
|
{
|
||||||
|
eval r=\$$1
|
||||||
|
r="${r//\&/&}"
|
||||||
|
r="${r//\</<}"
|
||||||
|
r="${r//\\\n/<br>}"
|
||||||
|
r="${r//\\/\}"
|
||||||
|
r="${r//\"/"}"
|
||||||
|
r="${r//\$/$}"
|
||||||
|
r="${r//\`/`}"
|
||||||
|
r="${r//\*/*}"
|
||||||
|
echo "${r}"
|
||||||
|
}
|
||||||
|
|
||||||
function kill_tree() {
|
function kill_tree() {
|
||||||
local killpid=$1
|
local killpid=$1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user