Fixes a bug in getCrawlList in a multi-machine setting, a=chris

Chris Pollett [2012-06-23 15:Jun:rd]
Fixes a bug in getCrawlList in a multi-machine setting, a=chris
Filename
controllers/crawl_controller.php
models/crawl_model.php
diff --git a/controllers/crawl_controller.php b/controllers/crawl_controller.php
index 66188f3d1..ddfeafd32 100644
--- a/controllers/crawl_controller.php
+++ b/controllers/crawl_controller.php
@@ -182,7 +182,8 @@ class CrawlController extends Controller implements CrawlConstants
         $return_arc_bundles = false;
         $return_recrawls = false;
         if(isset($_REQUEST["arg"]) ) {
-            $arg = $this->clean($_REQUEST["arg"], "int");
+            $arg = trim(webdecode($_REQUEST["arg"]));
+            $arg = $this->clean($arg, "int");
             if($arg == 3 || $arg == 1) {$return_arc_bundles = true; }
             if($arg == 3 || $arg == 2) {$return_recrawls = true; }
         }
diff --git a/models/crawl_model.php b/models/crawl_model.php
index d4eff5a0c..c6475d4e1 100755
--- a/models/crawl_model.php
+++ b/models/crawl_model.php
@@ -787,15 +787,14 @@ EOT;
         $machine_urls = NULL, $cache = false)
     {
         if($machine_urls != NULL && !$this->isSingleLocalhost($machine_urls)) {
-            $pre_arg = ($return_arc_bundles && $return_recrawls) ? 3 :
-                ($return_recrawls) ? 2 : ($return_arc_bundles) ? 1 : 0;
+            $arg = ($return_arc_bundles && $return_recrawls) ? 3 :
+                (($return_recrawls) ? 2 : (($return_arc_bundles) ? 1 : 0));
             $cache_file = CRAWL_DIR."/cache/".self::network_crawllist_base_name.
-                "$pre_arg.txt";
+                "$arg.txt";
             if($cache && file_exists($cache_file) && filemtime($cache_file)
                 + 300 > time() ) {
                 return unserialize(file_get_contents($cache_file));
             }
-            $arg = "arg=$pre_arg";
             $list_strings = $this->execMachines("getCrawlList",
                 $machine_urls, $arg);
             $list = $this->aggregateCrawlList($list_strings);
ViewGit