diff --git a/nlvmi b/nlvmi index ef095ff..a017b3e 100755 --- a/nlvmi +++ b/nlvmi @@ -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" diff --git a/web/index.php b/web/index.php index aefd91d..2619e7a 100644 --- a/web/index.php +++ b/web/index.php @@ -2,8 +2,9 @@ function clean($str) { $search = array('&' , '"' , "'" , '<' , '>' ); $replace = array('&', '"', ''', '<', '>' ); - $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'])){