Fix a bug in UrlParser::getPath that gave undefined offset notices, a=chris
Fix a bug in UrlParser::getPath that gave undefined offset notices, a=chris
diff --git a/bin/fetcher.php b/bin/fetcher.php
index 976241349..85f258359 100755
--- a/bin/fetcher.php
+++ b/bin/fetcher.php
@@ -1736,7 +1736,11 @@ class Fetcher implements CrawlConstants
} else {
$site_index = "[LINK]";
}
- crawlLog($site_index.". ".$site[self::URL]);
+ $subdoc_info = "";
+ if(isset($site[self::SUBDOCTYPE])) {
+ $subdoc_info = "(Subdoc: {$site[self::SUBDOCTYPE]})";
+ }
+ crawlLog($site_index.". $subdoc_info ".$site[self::URL]);
} // end for
if((count($this->to_crawl) <= 0 && count($this->to_crawl_again) <= 0) ||
diff --git a/lib/indexing_plugins/recipe_plugin.php b/lib/indexing_plugins/recipe_plugin.php
index 4d4ee2931..b7c354434 100644
--- a/lib/indexing_plugins/recipe_plugin.php
+++ b/lib/indexing_plugins/recipe_plugin.php
@@ -355,8 +355,6 @@ class RecipePlugin extends IndexingPlugin implements CrawlConstants
$recipes_summary[$recipe][self::HTTP_CODE];
$recipe_sites[] = $summary;
$meta_ids[] = "ingredient:".$cluster["ingredient"];
-echo "meta";
-print_r($meta_ids);
$index_shard->addDocumentWords($doc_key,
self::NEEDS_OFFSET_FLAG,
$word_counts, $meta_ids, true, false);
diff --git a/lib/url_parser.php b/lib/url_parser.php
index 1e09ec422..7360f88c7 100755
--- a/lib/url_parser.php
+++ b/lib/url_parser.php
@@ -275,6 +275,9 @@ class UrlParser
$path = $url_parts['path'];
$len = strlen($url);
+ if($len < 1) {
+ return NULL;
+ }
if($with_query_string && isset($url_parts['query'])) {
$path .= "?".$url_parts['query'];
} else if($with_query_string && $url[$len - 1] == "?") {