Fixes encode decode issue and status issue when running multiple crawls, a=chris

Chris Pollett [2019-06-12 16:Jun:th]
Fixes encode decode issue and status issue when running multiple crawls, a=chris
Filename
src/controllers/CrawlController.php
src/controllers/components/CrawlComponent.php
src/models/CrawlModel.php
diff --git a/src/controllers/CrawlController.php b/src/controllers/CrawlController.php
index 8d3be5051..8c7648989 100644
--- a/src/controllers/CrawlController.php
+++ b/src/controllers/CrawlController.php
@@ -293,7 +293,7 @@ class CrawlController extends Controller implements CrawlConstants
         if (!isset($_REQUEST["arg"])) {
             return;
         }
-        $channel = $this->clean($_REQUEST["arg"], "int");
+        $channel = $this->clean(L\webdecode($_REQUEST["arg"]), "int");
         $this->model("crawl")->sendStopCrawlMessage($channel);
     }
     /**
diff --git a/src/controllers/components/CrawlComponent.php b/src/controllers/components/CrawlComponent.php
index 6420b996a..35482421c 100644
--- a/src/controllers/components/CrawlComponent.php
+++ b/src/controllers/components/CrawlComponent.php
@@ -264,7 +264,7 @@ class CrawlComponent extends Component implements CrawlConstants
                     }
                     break;
                 case "stop":
-                    $channel = (empty($_REQUEST['channel'])) ? 0 :
+                    $channel = (!isset($_REQUEST['channel'])) ? 0 :
                         $parent->clean($_REQUEST['channel'], "int");
                     $crawl_param_file = C\CRAWL_DIR .
                         "/schedules/$channel-crawl_params.txt";
diff --git a/src/models/CrawlModel.php b/src/models/CrawlModel.php
index 64ca45f8c..0319606dd 100755
--- a/src/models/CrawlModel.php
+++ b/src/models/CrawlModel.php
@@ -625,7 +625,7 @@ EOT;
         $seed_info = null;
         $index_bundle_class = C\NS_LIB . ($is_double_index  ?
             "DoubleIndexBundle" : "IndexArchiveBundle");
-        if (file_exists($dir) || file_exists($re_dir)) {
+        if (file_exists($dir)) {
             $info = $index_bundle_class::getArchiveInfo($dir);
             if (!isset($info['DESCRIPTION']) ||
                 $info['DESCRIPTION'] == null ||
@@ -1499,7 +1499,7 @@ EOT;
             $count_fields = ["COUNT", "VISITED_URLS_COUNT_PER_HOUR",
                 "VISITED_URLS_COUNT"];
             if (empty($a_status)) {
-                return [];
+                continue;
             }
             foreach ($a_status as $channel => $a_status_data) {
                 if (empty($status[$channel])) {
ViewGit