From 1db5b0761e077453a42e380848c62e82ad720b5a Mon Sep 17 00:00:00 2001 From: PbIXTOP Date: Mon, 9 Nov 2015 13:18:38 +0700 Subject: Update stunnel.inc Fix using blank field in "Listen on IP" --- config/stunnel/stunnel.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/stunnel/stunnel.inc b/config/stunnel/stunnel.inc index 6dc17ef6..6233679b 100644 --- a/config/stunnel/stunnel.inc +++ b/config/stunnel/stunnel.inc @@ -177,7 +177,7 @@ function stunnel_save($config) { if ($pkgconfig['sourceip']) { fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); } - fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); + fwrite($fout, "accept = " . ($pkgconfig['localip'] ? $pkgconfig['localip'] . ":" : "") . $pkgconfig['localport'] . "\n"); fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); fwrite($fout, "TIMEOUTclose = 0\n\n"); } @@ -257,7 +257,7 @@ function stunnel_install() { if ($pkgconfig['sourceip']) { fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); } - fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); + fwrite($fout, "accept = " . ($pkgconfig['localip'] ? $pkgconfig['localip'] . ":" : "") . $pkgconfig['localport'] . "\n"); fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); fwrite($fout, "TIMEOUTclose = 0\n\n"); } -- cgit v1.2.3