You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-dev@incubator.apache.org by "Richard Frovarp (JIRA)" <ji...@apache.org> on 2010/02/26 18:41:28 UTC

[jira] Created: (DROIDS-83) LinkExtractor doesn't handle spaces in URI

LinkExtractor doesn't handle spaces in URI
------------------------------------------

                 Key: DROIDS-83
                 URL: https://issues.apache.org/jira/browse/DROIDS-83
             Project: Droids
          Issue Type: Bug
          Components: core
    Affects Versions: 0.01
            Reporter: Richard Frovarp


Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-83) LinkExtractor doesn't handle spaces in URI

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839112#action_12839112 ] 

Richard Frovarp commented on DROIDS-83:
---------------------------------------

That certainly is an idea. It's not the constructor throwing errors, it is resolve(String). There is a resolve(URI) where this idea may work. I'm not familiar enough with URIs to be able to write a regex to handle relative URIs, absolute URIs and odd URI's such as mailto.

> LinkExtractor doesn't handle spaces in URI
> ------------------------------------------
>
>                 Key: DROIDS-83
>                 URL: https://issues.apache.org/jira/browse/DROIDS-83
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Richard Frovarp
>         Attachments: link-whitespace-fix.patch
>
>
> Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DROIDS-83) LinkExtractor doesn't handle special characters in URI

Posted by "Thorsten Scherler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thorsten Scherler resolved DROIDS-83.
-------------------------------------

    Resolution: Fixed

Committed revision 939632.

> LinkExtractor doesn't handle special characters in URI
> ------------------------------------------------------
>
>                 Key: DROIDS-83
>                 URL: https://issues.apache.org/jira/browse/DROIDS-83
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Richard Frovarp
>         Attachments: link-whitespace-fix.patch
>
>
> Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DROIDS-83) LinkExtractor doesn't handle special characters in URI

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Frovarp updated DROIDS-83:
----------------------------------

    Summary: LinkExtractor doesn't handle special characters in URI  (was: LinkExtractor doesn't handle spaces in URI)

> LinkExtractor doesn't handle special characters in URI
> ------------------------------------------------------
>
>                 Key: DROIDS-83
>                 URL: https://issues.apache.org/jira/browse/DROIDS-83
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Richard Frovarp
>         Attachments: link-whitespace-fix.patch
>
>
> Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-83) LinkExtractor doesn't handle spaces in URI

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839899#action_12839899 ] 

Richard Frovarp commented on DROIDS-83:
---------------------------------------

Add to the list, the default code doesn't handle Window's slashes or pipes in the URI either.

Furthermore, there is something in this sequence that cause's problems as well:

-1&url1=http://<!--#echo%20var=>

> LinkExtractor doesn't handle spaces in URI
> ------------------------------------------
>
>                 Key: DROIDS-83
>                 URL: https://issues.apache.org/jira/browse/DROIDS-83
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Richard Frovarp
>         Attachments: link-whitespace-fix.patch
>
>
> Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-83) LinkExtractor doesn't handle spaces in URI

Posted by "Bertil Chapuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839019#action_12839019 ] 

Bertil Chapuis commented on DROIDS-83:
--------------------------------------

It seems that the other constructors provided by the URI class are automatically encoding the string. What about using regex in such a case?

        Pattern pattern = Pattern.compile("(.*)://(.*)(/.*)\\?(.*)#(.*)");
        Matcher matcher = pattern.matcher("http://www.test.com/test asdf?blabliblablo=bloublu#bbédu");
        matcher.find();
        String scheme = matcher.group(1);
        String host = matcher.group(2);
        String path = matcher.group(3);
        String query = matcher.group(4);
        String fragment = matcher.group(5);
        URI uri = new URI(scheme, host, path, query, fragment);

Best regards.

> LinkExtractor doesn't handle spaces in URI
> ------------------------------------------
>
>                 Key: DROIDS-83
>                 URL: https://issues.apache.org/jira/browse/DROIDS-83
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Richard Frovarp
>         Attachments: link-whitespace-fix.patch
>
>
> Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DROIDS-83) LinkExtractor doesn't handle spaces in URI

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839862#action_12839862 ] 

Richard Frovarp commented on DROIDS-83:
---------------------------------------

It also doesn't handle apostrophes. 

It also fails on <a href="#">. I don't expect this to work, but getting it so that it doesn't error would be nice.

> LinkExtractor doesn't handle spaces in URI
> ------------------------------------------
>
>                 Key: DROIDS-83
>                 URL: https://issues.apache.org/jira/browse/DROIDS-83
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Richard Frovarp
>         Attachments: link-whitespace-fix.patch
>
>
> Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DROIDS-83) LinkExtractor doesn't handle spaces in URI

Posted by "Richard Frovarp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Frovarp updated DROIDS-83:
----------------------------------

    Attachment: link-whitespace-fix.patch

Fixes space issues. There may be other modifications to links needed. I'll give our very inconsistent site another crawl next week to see what it comes up with for other problems.

> LinkExtractor doesn't handle spaces in URI
> ------------------------------------------
>
>                 Key: DROIDS-83
>                 URL: https://issues.apache.org/jira/browse/DROIDS-83
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Richard Frovarp
>         Attachments: link-whitespace-fix.patch
>
>
> Links with spaces aren't properly handled by the LinkExtractor. java.net.URI expects valid URI's, and spaces aren't allowed. Therefore, before resolving links, the URI's need to be cleaned up to what browsers can handle. This at least includes handling space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.