Issue 706 user-suggested patch for trimming bad whitespace on URI

git-svn-id: https://zxing.googlecode.com/svn/trunk@1712 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-02-02 13:55:44 +00:00
parent f53c4d532b
commit a55e645bfe
2 changed files with 4 additions and 0 deletions

View file

@ -79,6 +79,7 @@ public final class URIParsedResult extends ParsedResult {
* the protocol.
*/
private static String massageURI(String uri) {
uri = uri.trim();
int protocolEnd = uri.indexOf(':');
if (protocolEnd < 0) {
// No protocol, assume http

View file

@ -34,6 +34,9 @@ final class URIResultParser extends ResultParser {
if (rawText != null && rawText.startsWith("URL:")) {
rawText = rawText.substring(4);
}
if (rawText != null) {
rawText = rawText.trim();
}
if (!isBasicallyValidURI(rawText)) {
return null;
}