webworkoffice / partakein

Automatically exported from code.google.com/p/partakein
0 stars 0 forks source link

Hashtag validator admit incorrect hashtags. #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In Util.java, backslash and hyphen are handled as valid character.
>    public static boolean isValidHashtag(String hashTag) {
>       return hashTag.matches("#[a-zA-z0-9_\\-]+");
>    }
But they are invalid one actually.
"#hash-tag" and "#hash\tag" are incorrect hashtag, so this method should to 
return false.

To solve this issue, you can use library of Twitter, Inc.
This library is used by twitter.com, and supports variations of 
alphabets(\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff).
    Java implementation of the twitter text handling library
    https://github.com/mzsanford/twitter-text-java/blob/master/src/com/twitter/Regex.java

Please use the attached patch file for unit testing.

Original issue reported on code.google.com by skypencil@gmail.com on 12 Dec 2010 at 11:01

Attachments:

GoogleCodeExporter commented 9 years ago
We have to fix src/main/webapp/WEB-INF/events/inner-form.jsp too.
This page contains a message about hashtag's format.

Original comment by skypencil@gmail.com on 12 Dec 2010 at 11:51

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by kawanaka.shinya@gmail.com on 13 Dec 2010 at 3:40

GoogleCodeExporter commented 9 years ago

Original comment by kawanaka.shinya@gmail.com on 13 Dec 2010 at 3:52

GoogleCodeExporter commented 9 years ago
Migrated to http://github.com/partakein/partake/issues/19

Original comment by skypencil@gmail.com on 27 Jun 2012 at 9:26