Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Mention feature is not working for urdu user names.

Hi,
mention feature is working nice for English user names but it is not working for Urdu user names, any one knows about this issue?

Best Answer

Answers

  • hgtonighthgtonight MVP
    edited November 2013

    What version number of Vanilla are you running?

    The current mention system uses a regex to find and replace the @name with a link to the associated profile. It looks for word characterd , \w, after @ signs.

    The \w character only matches latin characters as far as I know.

    You would have to update the regex to also match urdu characters.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight said:
    What version number of Vanilla are you running?

    The current mention system uses a regex to find and replace the @name with a link to the associated profile. It looks for word characterd , \w, after @ signs.

    The \w character only matches latin characters as far as I know.

    You would have to update the regex to also match urdu characters.

    verion is 2-0-18-8
    How i can update regex?

  • Mentions are formatted through the Mentions($Mixed) method in /library/core/class.format.php.

    You can override the mentions in an upgrade safe way by creating a MentionsFormatter class that has a FormatMentions method and including it in your conf.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight said:
    Mentions are formatted through the Mentions($Mixed) method in /library/core/class.format.php.

    You can override the mentions in an upgrade safe way by creating a MentionsFormatter class that has a FormatMentions method and including it in your conf.

    can you give an example to make it easy....i have very little knowledge about php.

  • I can't think of an example.

    I can think of 3 easy solutions:

    • Disable mentions
    • Don't allow usernames with Urdu characters in them
    • Pay somebody to fix your issues

    I can also think of the solution I would employ:

    • Create a MentionsFormatter class with a FormatMentions method to override the the Mentions($Mixed) method in /library/core/class.format.php.
    • Test
    • Iterate

    I am not trying to blow you off. I don't have any experience with Urdu characters.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.