bugfix nginx config

This commit is contained in:
nativemad 2018-10-26 18:21:18 +02:00
parent 8ea03bd645
commit b5772b2651
2 changed files with 5 additions and 4 deletions

4
nlvmi
View File

@ -198,7 +198,7 @@ function vmstart {
rm $TMPF
fi
fi
if [ -n $WPORT ] && [ -n $NGINXCONFIGPATH ]; then
if [ ! -z $WPORT ] && [ ! -z $NGINXCONFIGPATH ]; then
echo "location /${array[1]}/ {" >$NGINXCONFIGPATH/${array[1]}.conf
echo " proxy_pass http://${array[3]}:$WPORT/;" >>$NGINXCONFIGPATH/${array[1]}.conf
echo " proxy_http_version 1.1;" >>$NGINXCONFIGPATH/${array[1]}.conf
@ -207,7 +207,7 @@ function vmstart {
echo " proxy_read_timeout 61s;" >>$NGINXCONFIGPATH/${array[1]}.conf
echo " proxy_buffering off;" >>$NGINXCONFIGPATH/${array[1]}.conf
echo "}" >>$NGINXCONFIGPATH/${array[1]}.conf
if [ -n $NGINXRESTARTCOMMAND ]; then $NGINXRESTARTCOMMAND; fi
if [ ! -z $NGINXRESTARTCOMMAND ]; then $NGINXRESTARTCOMMAND; fi
fi
done
export VMFOUND="yes"

View File

@ -2,8 +2,9 @@
function clean($str) {
$search = array('&' , '"' , "'" , '<' , '>' );
$replace = array('&amp;', '&quot;', '&#39;', '&lt;', '&gt;' );
$str = str_replace($search, $replace, $str);
return $str;
$str = str_replace($search, $replace, $str);
$strf = htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
return $strf;
}
if(isset($_REQUEST['logout'])){