HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Mentions+ setting problem. Your help will be appreciated.

2»

Comments

  • @Bleistivt said:
    You can't have grouping or delimiters in the regex, as it gets wrapped in [ ]

    try \.?{Hangul}+

    Also make sure you reverted all of the changes you made above that were unnecessary.

    Oh,, shouldn't I use / and [ ] ? OK... that's why sometimes contents are viewable or not during many regex trials.

    Without that, contents are viewable, but Mention feature is not working.

  • peregrineperegrine MVP
    edited September 2014

    you should try to debug with breakpoints or a separate test program just to test the matches, against a few hardcoded names and then also put breakpoints in to see what is being checked or returned.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • but \w\d_\- \x{AC00}-\x{D7A3} this case also not viewable.(without / and [])

    I am getting lost.

  • @peregrine said:
    you should try to debug with breakpoints or a separate test program just to test the matches, against a few hardcoded names and then also put breakpoints in to see what is being checked or returned.

    Ehh.... I don't understand what to do ;-(

  • peregrineperegrine MVP
    edited September 2014

    http://php.net/manual/en/function.preg-match.php

    create a new program outside of vanilla try regex to match a korean name. and then with @_koreanname

    once you've got a decent expression. try it

    if you can't match outside vanilla, you won't match inside vanilla

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • this is what I meant.

    unfortunately the regex breaks in the validation expression but seems to work here (if I am not deluding myself....

    <!DOCTYPE html>
    <meta charset="utf-8" />
    <?php
    //$pattern ='/[\^\w_\x{AC00}-\x{D7A3}\s]$/u';
    // $pattern ='/(\p{Hangul}+)/u';
    $pattern ='/[\p{Han}+\p{Katakana}+\p{Hiragana}+\p{Hangul}]+/iu';
     // $match_string = "印刷最安 ニ";
    
     $match_string = "@_印刷最계란말이 산책책로123 는여 기 사는 ";
    
    if (preg_match($pattern, $match_string,$matches)) {
        echo "Found - pattern $pattern";
    } else {
        echo "Not found - pattern $pattern";
    }
    echo "<pre>";
    var_dump($matches);
    echo "</pre>";
    

    ?>

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • boardwalkboardwalk New
    edited September 2014

    Would you guys give me more your own Regex EXAMPLES? so that I can compare with it.

    The default value of Mentions+ is \d\w_ äöüß (is it German?)

    Anyway, I added new user äöüß , and tried to make mention: @äöüß but it didn't work.

    It should work... shouldn't it? ...

    Ah.. that was not the proper word. I made another user Schön

    and @Schön is working

  • R_JR_J Ex-Fanboy Munich Admin

    That's a bug! Yes, those characters are German special characters and mentions do not work as expected if the umlaut is the last character of the username. Great finding, thanks for that! I'll work on it and also try to work out the correct setting for Korean characters. Please be patient!

  • @R_J said:
    That's a bug! Yes, those characters are German special characters and mentions do not work as expected if the umlaut is the last character of the username. Great finding, thanks for that! I'll work on it and also try to work out the correct setting for Korean characters. Please be patient!

    Oh... it seems that I found out something important... :wink: (I didn't mean to but...)

    Wow, are you going to check Korean language regex for me?
    and does it mean that I should stop trying to put new combinations of regex for Korean characters by myself?

    I have been trying to put a lot of cases of regex, but nothing worked properly.
    Can I stop this agony for a moment? lol.

  • R_JR_J Ex-Fanboy Munich Admin

    All fixed now, and support for Korean letters works right from the start!

    I've uploaded a new version. Now if you simply put in \d\w everything should be fine. You can add underscore, dash and space if you like to allow that characters, too (\d\w_-). Note that usernames with spaces have to be mentioned like that @힣가 힣가. I've tested it with @가-힣가-힣가-힣 and @가힣가 and they have been formatted correctly. Because I had no users like that, I simply assume that also the notification is working. Please tell me if that still doesn't work.

    You now have to do the following:
    a) download the current version: http://vanillaforums.org/get/mentionsplus-plugin-0.12
    b) unzip it into the plugin folder
    c) goto settings and enter \d\w-_ to let mentions work with numbers ("\d"), letters ("\w" including Korean!), dash and underscore ("-_"). Save that.

    I hope it works now. Thanks for helping making that plugin more versatile :)

  • boardwalkboardwalk New
    edited September 2014

    Wow~! It is working now partly, but have some problems:

    1) Username with space is not working.

    ..

    2) 2 characters not working. (by the VF default?)

    ..

    3) I can't sign-out. Cannot choose this button properly. If I click #3 it goes to edit profile page automatically.

    .. no more this drop down. I used to select sign out and more options with #3 button like this picture:

    ..

    4) I have lost of my control on editing posts.
    The edit buttons can't be selected. (I tried with Admin account also)

    ps. I am not sure number 3~4 is occurred by Mentions+, so I tried to disable Mentions+ then I can't approach to my plugins page and discussions. It crashed.

  • R_JR_J Ex-Fanboy Munich Admin

    1) You have to mention users with spaces in their names like that @"abc def". Those escaping characters can be set in the settingsscreen, so you can change it to something like that: @[abc def].

    2) In the settings screen, there is an option for changing min and max length of usernames. You'll have to change that setting accordingly if you like to use it with 2-letter-user-names.

    3) + 4) Current Vanilla version has a JavaScript bug. @peregrine is the master of solving that issue. Maybe he can point to the comment where the solution is described most clearly

  • boardwalkboardwalk New
    edited September 2014

    Ah.. right.. I forgot about the basic description. 1)~2). I will check it again.
    Anyway, now my site is crashed all since I disabled Mentions+

  • R_JR_J Ex-Fanboy Munich Admin
    edited September 2014

    Don't forget to comment out the line in bootstrap.after.php when you want to disable mentions+!

  • boardwalkboardwalk New
    edited September 2014

    JS error was Global.js error again. I had this before. (peregrine already told me how to solve it before)

    I just forgot to change some code in global.js with my new installed VF.

    I will do this again, and let you know.

Sign In or Register to comment.