diff --git a/copyvios/checker.py b/copyvios/checker.py index ca96932..57e2085 100644 --- a/copyvios/checker.py +++ b/copyvios/checker.py @@ -56,8 +56,11 @@ def _get_results(query, follow=True): query.action = "compare" if query.url else "search" if query.action == "search": conn = get_cache_db() - use_engine = 1 if query.use_engine else 0 - use_links = 1 if query.use_links else 0 + use_engine = 1 if query.use_engine != "" else 0 + use_links = 1 if query.use_links != "" else 0 + if not use_engine and not use_links: + query.error = "no search method" + return mode = "{0}:{1}:".format(use_engine, use_links) if not query.nocache: query.result = _get_cached_results(page, conn, query, mode) diff --git a/copyvios/misc.py b/copyvios/misc.py index c073d2d..dfb70ae 100644 --- a/copyvios/misc.py +++ b/copyvios/misc.py @@ -15,10 +15,12 @@ class Query(object): def __init__(self, method="GET"): self.query = {} if method == "GET": - parsed = parse_qs(request.environ["QUERY_STRING"]) + parsed = parse_qs(request.environ["QUERY_STRING"], + keep_blank_values=True) elif method == "POST": size = int(request.environ.get("CONTENT_LENGTH", 0)) - parsed = parse_qs(request.environ["wsgi.input"].read(size)) + parsed = parse_qs(request.environ["wsgi.input"].read(size), + keep_blank_values=True) else: parsed = {} for key, value in parsed.iteritems(): diff --git a/templates/index.mako b/templates/index.mako index a17be30..4d7f6cd 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -10,6 +10,10 @@
Unknown action: ${query.action | h}.
No copyvio search methods were selected. A check can only be made using a search engine, links present in the page, or both.
+URL comparison mode requires a URL to be entered. Enter one in the text box below, or choose copyvio search mode to look for content similar to the article elsewhere on the web.
@@ -101,9 +105,9 @@