Kaynağa Gözat

Fix bad URI error thing.

pull/24/head
Ben Kurtovic 10 yıl önce
ebeveyn
işleme
d2dff9f05d
2 değiştirilmiş dosya ile 7 ekleme ve 10 silme
  1. +1
    -1
      copyvios/checker.py
  2. +6
    -9
      templates/index.mako

+ 1
- 1
copyvios/checker.py Dosyayı Görüntüle

@@ -35,7 +35,7 @@ def _get_results(query):


if query.url: if query.url:
if urlparse(query.url).scheme not in ["http", "https"]: if urlparse(query.url).scheme not in ["http", "https"]:
query.result = "bad URI"
query.error = "bad URI"
return return
query.result = page.copyvio_compare(query.url) query.result = page.copyvio_compare(query.url)
query.result.cached = False query.result.cached = False


+ 6
- 9
templates/index.mako Dosyayı Görüntüle

@@ -1,11 +1,13 @@
<%!
from flask import g, request
%>\
<%! from flask import g, request %>\
<%include file="/support/header.mako" args="title='Earwig\'s Copyvio Detector'"/> <%include file="/support/header.mako" args="title='Earwig\'s Copyvio Detector'"/>
<%namespace module="copyvios.highlighter" import="highlight_delta"/>\ <%namespace module="copyvios.highlighter" import="highlight_delta"/>\
<%namespace module="copyvios.misc" import="urlstrip"/>\ <%namespace module="copyvios.misc" import="urlstrip"/>\
% if query.project and query.lang and (query.title or query.oldid): % if query.project and query.lang and (query.title or query.oldid):
% if not query.site:
% if query.error == "bad URI":
<div id="info-box" class="red-box">
<p>Unsupported URI scheme: <a href="${query.url | h}">${query.url | h}</a>.</p>
</div>
% elif not query.site:
<div id="info-box" class="red-box"> <div id="info-box" class="red-box">
<p>The given site (project=<b><span class="mono">${query.project | h}</span></b>, language=<b><span class="mono">${query.lang | h}</span></b>) doesn't seem to exist. It may also be closed or private. <a href="//${query.lang | h}.${query.project | h}.org/">Confirm its URL.</a></p> <p>The given site (project=<b><span class="mono">${query.project | h}</span></b>, language=<b><span class="mono">${query.lang | h}</span></b>) doesn't seem to exist. It may also be closed or private. <a href="//${query.lang | h}.${query.project | h}.org/">Confirm its URL.</a></p>
</div> </div>
@@ -17,11 +19,6 @@
<div id="info-box" class="red-box"> <div id="info-box" class="red-box">
<p>The given revision ID doesn't seem to exist: <a href="//${query.site.domain | h}/w/index.php?oldid=${query.oldid | h}">${query.oldid | h}</a>.</p> <p>The given revision ID doesn't seem to exist: <a href="//${query.site.domain | h}/w/index.php?oldid=${query.oldid | h}">${query.oldid | h}</a>.</p>
</div> </div>
% elif query.url and result == "bad URI":
<% result = None %>
<div id="info-box" class="red-box">
<p>Unsupported URI scheme: <a href="${query.url | h}">${query.url | h}</a>.</p>
</div>
% endif % endif
%endif %endif
<p>This tool attempts to detect <a href="//en.wikipedia.org/wiki/WP:COPYVIO">copyright violations</a> in articles. Simply give the title of the page or ID of the revision you want to check and hit Submit. The tool will search for similar content elsewhere on the web using <a href="//info.yahoo.com/legal/us/yahoo/boss/pricing/">Yahoo! BOSS</a> and then display a report if a match is found. If you give a URL, it will skip the search engine step and directly display a report comparing the article to that particular webpage, like the <a href="//toolserver.org/~dcoetzee/duplicationdetector/">Duplication Detector</a>.</p> <p>This tool attempts to detect <a href="//en.wikipedia.org/wiki/WP:COPYVIO">copyright violations</a> in articles. Simply give the title of the page or ID of the revision you want to check and hit Submit. The tool will search for similar content elsewhere on the web using <a href="//info.yahoo.com/legal/us/yahoo/boss/pricing/">Yahoo! BOSS</a> and then display a report if a match is found. If you give a URL, it will skip the search engine step and directly display a report comparing the article to that particular webpage, like the <a href="//toolserver.org/~dcoetzee/duplicationdetector/">Duplication Detector</a>.</p>


Yükleniyor…
İptal
Kaydet