Index: /trunk/bin/module_maker/module.cli.php
===================================================================
--- /trunk/bin/module_maker/module.cli.php	(revision 806)
+++ /trunk/bin/module_maker/module.cli.php	(revision 807)
@@ -207,5 +207,5 @@
         $default = $col[4];
 
-        if (mb_strpos($default, '0000') !== false || '0' == $default) {
+        if (is_null($default) || mb_strpos($default, '0000') !== false || '0' == $default) {
             $default = '';
         }
Index: /trunk/bin/module_maker/validation.cli.php
===================================================================
--- /trunk/bin/module_maker/validation.cli.php	(revision 806)
+++ /trunk/bin/module_maker/validation.cli.php	(revision 807)
@@ -292,5 +292,5 @@
             }
             $negative_ok = $unsigned ? 'false' : 'true';
-            $o[] = "\$fv->isDecimal('$field', $max_dig, $max_dec, false, sprintf(_(\"%s must be a number with a maximum of %d integer digits and %d fractional digits, e.g., {EX}.\"), _(\"$title\"), ${max_dig}-${max_dec}, $max_dec), MSG_ERR, __FILE__, __LINE__);";
+            $o[] = "\$fv->isDecimal('$field', $max_dig, $max_dec, false, sprintf(_(\"%s must be a number with a maximum of %d integer digits and %d fractional digits, e.g., {EX}.\"), _(\"$title\"), {$max_dig}-{$max_dec}, $max_dec), MSG_ERR, __FILE__, __LINE__);";
             break;
 
Index: /trunk/lib/FormValidator.inc.php
===================================================================
--- /trunk/lib/FormValidator.inc.php	(revision 806)
+++ /trunk/lib/FormValidator.inc.php	(revision 807)
@@ -694,5 +694,5 @@
     public function fileUploadSize($form_name, $msg='', $type=MSG_ERR, $file=null, $line=null)
     {
-        if (Validator::fileUploadSize($form_name, LOG_NOTICE, $file, $line)) {
+        if (Validator::fileUploadSize(LOG_NOTICE, $file, $line)) {
             return true;
         } else {
Index: /trunk/lib/Utilities.inc.php
===================================================================
--- /trunk/lib/Utilities.inc.php	(revision 806)
+++ /trunk/lib/Utilities.inc.php	(revision 807)
@@ -25,4 +25,5 @@
  */
 
+require_once dirname(__FILE__) . '/App.inc.php';
 
 /**
@@ -186,9 +187,11 @@
     $app =& App::getInstance();
 
+    $indent = trim($indent, ' ') . ' ';
+
     $indent_str = str_repeat($indent, $depth);
     $output = '';
     if (is_array($var)) {
         foreach ($var as $k=>$v) {
-            $k = ucfirst(mb_strtolower(str_replace(array('_', '  '), ' ', $k)));
+            $k = ucfirst(mb_strtolower(str_replace(['_', '  '], ' ', $k)));
             if (is_array($v)) {
                 $output .= sprintf("\n%s%s:\n%s\n", $indent_str, $k, fancyDump($v, $indent, $depth+1));
@@ -200,5 +203,14 @@
         $output .= sprintf("%s%s\n", $indent_str, $var);
     }
-    return preg_replace(['/^[ \t]+$/' . $app->getParam('preg_u'), '/\n\n+/' . $app->getParam('preg_u'), '/^(?:\S( ))?(?:\S( ))?(?:\S( ))?(?:\S( ))?(?:\S( ))?(?:\S( ))?(?:\S( ))?(?:\S( ))?(\S )/m' . $app->getParam('preg_u')], ['', "\n", '$1$1$2$2$3$3$4$4$5$5$6$6$7$7$8$8$9'], $output);
+
+    return preg_replace([
+        '/^[ \t]+$/' . $app->getParam('preg_u'),
+        '/\n\n+/' . $app->getParam('preg_u'),
+        sprintf('/^(?:%1$s( ))?(?:%1$s( ))?(?:%1$s( ))?(?:%1$s( ))?(?:%1$s( ))?(?:%1$s( ))?(?:%1$s( ))?(?:%1$s( ))?(%1$s )/m%2$s', preg_quote(trim($indent, ' '), '/'), $app->getParam('preg_u')),
+    ], [
+        '',
+        "\n",
+        '$1$1$2$2$3$3$4$4$5$5$6$6$7$7$8$8$9'
+    ], $output);
 }
 
@@ -1516,5 +1528,9 @@
 
     $addr = canonicalIPAddr(trim($_SERVER['REMOTE_ADDR']));
-    return $dolookup && $addr ? gethostbyaddr($addr) : $addr;
+    if (false !== filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
+        return $dolookup && '' != $addr ? gethostbyaddr($addr) : $addr;
+    }
+
+    return '';
 }
 
Index: /trunk/lib/Validator.inc.php
===================================================================
--- /trunk/lib/Validator.inc.php	(revision 806)
+++ /trunk/lib/Validator.inc.php	(revision 807)
@@ -520,8 +520,8 @@
     *
     * @param  string $form_name The input data to validate.
-    * @param  const  $type  A LOG_* constant (see App->logMsg())
-    * @param  string $file  Filename to log (usually __FILE__)
-    * @param  int    $line  Line number to log (usually __LINE__)
-    * @return bool   True if no errors found, false otherwise.
+    * @param  const  $type      A LOG_* constant (see App->logMsg())
+    * @param  string $file      Filename to log (usually __FILE__)
+    * @param  int    $line      Line number to log (usually __LINE__)
+    * @return bool              True if no errors found, false otherwise.
     */
     static public function fileUploaded($form_name, $type=LOG_DEBUG, $file=null, $line=null)
@@ -555,14 +555,13 @@
     *
     * @access   public
-    * @param    string $form_name The input data to validate.
-    * @param  const  $type  A LOG_* constant (see App->logMsg())
-    * @param  string $file  Filename to log (usually __FILE__)
-    * @param  int    $line  Line number to log (usually __LINE__)
-    * @return   bool   True if no errors found, false otherwise.
+    * @param    const  $type  A LOG_* constant (see App->logMsg())
+    * @param    string $file  Filename to log (usually __FILE__)
+    * @param    int    $line  Line number to log (usually __LINE__)
+    * @return   bool          True if no errors found, false otherwise.
     * @author   Quinn Comendant <quinn@strangecode.com>
     * @version  1.0
     * @since    20 Aug 2014 14:44:23
     */
-    static public function fileUploadSize($form_name, $type=LOG_DEBUG, $file=null, $line=null)
+    static public function fileUploadSize($type=LOG_DEBUG, $file=null, $line=null)
     {
         $app =& App::getInstance();
@@ -575,4 +574,29 @@
     }
 
+    /*
+    *
+    *
+    * @access   public
+    * @param
+    * @return
+    * @author   Quinn Comendant <quinn@strangecode.com>
+    * @since    09 Feb 2024 21:03:57
+    */
+    public static function IPAddress($val, $flags=null, $type=LOG_DEBUG, $file=null, $line=null)
+    {
+        $app =& App::getInstance();
+        if (is_string($val) && '' === trim($val)) {
+            // Don't be too bothered about empty strings.
+            return true;
+        }
+
+        if (!filter_var($val, FILTER_VALIDATE_IP, $flags)) {
+            $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($val)), $type, $file, $line);
+            return false;
+        } else {
+            return true;
+        }
+    }
+
 } // THE END
 
