changeset 2735:06ce4399639c

Fixes to wizards.txt parser.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 08 Mar 2024 12:28:30 +0200
parents b98d26cf51b2
children 7948d14d3893
files www/common.inc.php
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/www/common.inc.php	Fri Mar 08 12:27:57 2024 +0200
+++ b/www/common.inc.php	Fri Mar 08 12:28:30 2024 +0200
@@ -480,11 +480,16 @@
   {
     $tmp = ["name" => $name, "areas" => 0];
 
-    $countries = array_filter(preg_split("/\s*\|\s*/", $record[2]),
+    $countries = array_map(
+      function ($item)
+      {
+        return strtolower($item);
+      },
+      array_filter(preg_split("/\s*\|\s*/", $record[2]),
       function ($item)
       {
         return $item != "";
-      });
+      }));
 
     if (count($countries) > 0)
       $tmp["countries"] = $countries;
@@ -517,13 +522,13 @@
     {
       if (substr($line, -1, 1) == '$')
       {
-        $record[4] .= " ".substr($line, 0, -1);
+        $record[5] .= " ".trim(substr($line, 0, -1));
         $contMode = FALSE;
         mpStoreWizInfoRecordInfo($table, $record);
       }
       else
       {
-        $record[4] .= " ".$line;
+        $record[5] .= " ".trim($line);
       }
     }
     else