Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue mentioning two-part / hyphenated names #2730

Closed
ghost opened this issue Aug 21, 2017 · 11 comments
Closed

issue mentioning two-part / hyphenated names #2730

ghost opened this issue Aug 21, 2017 · 11 comments

Comments

@ghost
Copy link

ghost commented Aug 21, 2017

Hi,

I use humhub ver 1.1.2 and when i try to mention a user with a two part name, i can't find the user.

But i can find him if i start the mentionning with the second part of the name. For instance, if i try to mention Jean-Pierre Smith, typing @Jean-Pierre will show nothing; but typing @pierre will find the correct user. It's the same behaviour with two-part last names.

I did a quick search trough existing issues and saw nothing related to the subject. Is is still an existing issue on new versions? If not, at what point was the problem solved?

Thanks!

@ghost
Copy link
Author

ghost commented Aug 21, 2017

mentioning_1
mentioning_2
mentioning_3

Some screenshots from the community humhub...

@Felli
Copy link
Contributor

Felli commented Aug 21, 2017

I think that if you start a @mention with the first name and then don't find your target, adding the last name will always find it. I believe this isn't exactly a bug, just somewhat of a flaw within mentioning. As for Hyphenated names, yes I do see the issue you're talking about.

Examples

First name

screenshot_1

Exact name

screenshot_2

Last name

screenshot_3

Hyphenated name

screenshot_4

After words a mentioning hangup happens.

@buddh4
Copy link
Contributor

buddh4 commented Aug 21, 2017

perhaps we just have to align the regex a bit

@ghost
Copy link
Author

ghost commented Aug 21, 2017

I'll give it a try when i have time / when i find the regex.

If i find a fix, it will be for version 1.1.2 but i'll let you know about it and i'm sure it won't need too much work to adapt to the new version.

On the other hand, if you could pinpoint the file and function/lines/bloc concerned, i'd be more than happy. I still spend way too much time to find the right code in the source before doing actual fixes.

Thanks for the quick feedback!

@buddh4
Copy link
Contributor

buddh4 commented Aug 21, 2017

Hmm I could fix it by adding - to this array in ZendLuceneSearch, will do some further testing tomorrow.

@Felli
Copy link
Contributor

Felli commented Aug 22, 2017

@buddh4 wouldn't it also be a better idea to use
$keyword = str_replace(array('-', '*', '?', '_', '$'), ' ', mb_strtolower($keyword, 'utf8mb4')); instead?

@ghost
Copy link
Author

ghost commented Aug 22, 2017

After my first tests, adding '-' to the array seems to work well on version 1.1.2 (yay!)

I haven't tried changing mb_strtolower($keyword, 'utf8mb4') though, i'll wait buddh4's opinions on the subject.

@buddh4
Copy link
Contributor

buddh4 commented Aug 22, 2017

think utf8mb4 is mysql specific

@Felli
Copy link
Contributor

Felli commented Aug 22, 2017

Using $keyword = str_replace(array('-', '*', '?', '_', '$'), ' ', mb_strtolower($keyword, 'utf-8')); showed no finds when testing in v1.2.2 for me, but switching over to $keyword = str_replace(array('-', '*', '?', '_', '$'), ' ', mb_strtolower($keyword, 'utf8mb4')); picked up searches, maybe make it optional?

@buddh4
Copy link
Contributor

buddh4 commented Aug 22, 2017

As I said utf8mb4 is mysql specific php supports the following encodings: http://php.net/manual/en/mbstring.supported-encodings.php

@Felli
Copy link
Contributor

Felli commented Aug 22, 2017

Hmm... Then I'll be doing some test to see why utf-8 isn't working on my server...

@buddh4 buddh4 closed this as completed in 4f8fca8 Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants