Improve URL error messages 411, 412, 413

This commit is contained in:
Bryan Housel
2019-01-10 21:35:13 -05:00
parent 7f321abbaf
commit ae8dffa43c
4 changed files with 28 additions and 12 deletions

View File

@@ -891,11 +891,11 @@ en:
title: 'Website issue'
description: 'There is an unspecified issue with a contact website or URL.'
411:
description: 'The URL {var1} cannot be opened (HTTP status code {var2}).'
description: '{var1} may have an outdated URL: {var2} returned HTTP status code {var3}.'
412:
description: 'Possible domain squatting: The URL has suspicious text: "{var1}".'
description: '{var1} may have an outdated URL: {var2} contained suspicious text "{var3}".'
413:
description: 'Possible non-match. Content of the URL did not contain these keywords: ({var1}).'
description: '{var1} may have an outdated URL: {var2} did not contain keywords "{var3}".'
streetside:
tooltip: "Streetside photos from Microsoft"
title: "Photo Overlay (Bing Streetside)"

View File

@@ -475,20 +475,23 @@
"411": {
"title": "http error",
"severity": "error",
"description": "The URL (<a target=\"_blank\" href=\"$1\">$1</a>) cannot be opened (HTTP status code $2)",
"regex": "href=(.+)>\\1</a>\\) cannot be opened \\(HTTP status code (\\d+)\\)"
"description": "The URL (<a target=_blank href=$1>$1</a>) cannot be opened (HTTP status code $2)",
"IDs": ["this", "url", ""],
"regex": "(this feature)~.+ href=([^>]+)>.+ code (\\d+)\\)"
},
"412": {
"title": "domain hijacking",
"severity": "error",
"description": "Possible domain squatting: <a target=\"_blank\" href=\"$1\">$1</a>. Suspicious text is: \"$2\"",
"regex": "Possible domain squatting: <a target=_blank href=(.+)>\\1</a>\\. Suspicious text is: &quot;(.+)&quot;"
"description": "Possible domain squatting: <a target=_blank href=$1>$1</a>. Suspicious text is: \"$2\"",
"IDs": ["this", "url", ""],
"regex": "(this feature)~.+ href=([^>]+)>.+ is: &quot;(.+)&quot;"
},
"413": {
"title": "non-match",
"severity": "error",
"description": "Content of the URL (<a target=\"_blank\" href=\"$1\">$1</a>) did not contain these keywords: ($2)",
"regex": "Content of the URL (<a target=_blank href=(.+)>\\1</a>) did not contain these keywords: \\((.+)\\)"
"description": "Content of the URL (<a target=_blank href=$1>$1</a>) did not contain these keywords: ($2)",
"IDs": ["this", "url", ""],
"regex": "(this feature)~.+ href=([^>]+)>.+ keywords: \\((.+)\\)"
}
}
}

View File

@@ -1097,13 +1097,13 @@
"description": "There is an unspecified issue with a contact website or URL."
},
"411": {
"description": "The URL {var1} cannot be opened (HTTP status code {var2})."
"description": "{var1} may have an outdated URL: {var2} returned HTTP status code {var3}."
},
"412": {
"description": "Possible domain squatting: The URL has suspicious text: \"{var1}\"."
"description": "{var1} may have an outdated URL: {var2} contained suspicious text \"{var3}\"."
},
"413": {
"description": "Possible non-match. Content of the URL did not contain these keywords: ({var1})."
"description": "{var1} may have an outdated URL: {var2} did not contain keywords \"{var3}\"."
}
}
}

View File

@@ -135,6 +135,10 @@ function parseError(capture, idType) {
capture = linkErrorObject(capture);
break;
case 'url':
capture = linkURL(capture);
break;
// link an entity ID
case 'n':
case 'w':
@@ -171,6 +175,10 @@ function parseError(capture, idType) {
return '<a class="kr_error_entity_link">' + d + '</a>';
}
function linkURL(d) {
return '<a class="kr_external_link" target="_blank" href="' + d + '">' + d + '</a>';
}
// arbitrary node list of form: #ID, #ID, #ID...
function parse211(capture) {
var newList = [];
@@ -341,6 +349,11 @@ export default {
case '300':
props.description = 'This highway is missing a maxspeed tag';
break;
case '411':
case '412':
case '413':
props.description = 'This feature~' + props.description;
break;
}
// - move markers slightly so it doesn't obscure the geometry,