From a888c96ce880ddf18de43b0e5097d8982180d408 Mon Sep 17 00:00:00 2001 From: Nathan Pipes Date: Sat, 8 Mar 2014 22:09:17 +0800 Subject: [PATCH] Fixes isrequired The isrequired flag did not support IP6 localhost, nor did it allow 192.168 addresses, normally used for local private networks. Now it does --- install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.php b/install.php index af959e385..df9b08e08 100644 --- a/install.php +++ b/install.php @@ -386,7 +386,7 @@ class e_install // $page_info = nl2br(LANINS_023); $page_info = "
Please fill in the form below with your MySQL details. If you do not know this information, please contact your hosting provider. You may hover over each field for additional information.
"; $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); - $isrequired = (($_SERVER['SERVER_ADDR'] == "127.0.0.1") || ($_SERVER['SERVER_ADDR'] == "localhost")) ? "" : "required='required'"; // + regex for 198.168.x.x + $isrequired = (($_SERVER['SERVER_ADDR'] == "127.0.0.1") || ($_SERVER['SERVER_ADDR'] == "localhost") || ($_SERVER['SERVER_ADDR'] == "::1") || preg_match('^192\.168\.\d{1,3}\.\d{1,3}$',$_SERVER['SERVER_ADDR'])) ? "" : "required='required'"; // Deals with IP V6, and 192.168.x.x address ranges, could be improved to validate x.x to a valid IP but for this use, I dont think its required to be that picky. $output = "