Closed Bug 1728942 Opened 3 years ago Closed 3 years ago

Searching ldap address book with Chinese character doesn't work

Categories

(Thunderbird :: Address Book, defect)

Thunderbird 91
defect

Tracking

(thunderbird_esr91+ fixed, thunderbird92 wontfix, thunderbird93+ fixed)

RESOLVED FIXED
94 Branch
Tracking Status
thunderbird_esr91 + fixed
thunderbird92 --- wontfix
thunderbird93 + fixed

People

(Reporter: koungho, Assigned: rnons)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

  1. Open Address Book
  2. Select Ldap Directory from left panel
  3. Type some Chinese character like "王" in search field, then press Enter

Actual results:

Display no result, can't find anything

Expected results:

It should have found some names

Ldap server log

[03/Sep/2021:13:13:38.678841267 +0800] conn=5089 op=0 RESULT err=0 tag=97 nentries=0 wtime=0.000047041 optime=0.000064271 etime=0.000108957 dn=""
[03/Sep/2021:13:13:38.688631527 +0800] conn=5089 op=1 SRCH base="dc=ds1,dc=mydomain,dc=com,dc=tw" scope=2 filter="(&(|(cn=*%E7%8E%8B*)(givenName=*%E7%8E%8B*)(sn=*%E7%8E%8B*)(mozillaNickname=*%E7%8E%8B*)(mail=*%E7%8E%8B*)(mozillaSecondEmail=*%E7%8E%8B*)(&(null=TRUE)(description=*%E7%8E%8B*))(o=*%E7%8E%8B*)(ou=*%E7%8E%8B*)(title=*%E7%8E%8B*)(mozillaWorkUrl=*%E7%8E%8B*)(mozillaHomeUrl=*%E7%8E%8B*)))" attrs=ALL
[03/Sep/2021:13:13:38.705923772 +0800] conn=5089 op=1 RESULT err=0 tag=101 nentries=0 wtime=0.000129649 optime=0.017291965 etime=0.017419271 notes=U details="Partially Unindexed Filter" - Invalid attribute in filter - results may not be complete.```

Same query filter using Apache Directory Studio and actually find some names.

    (|
        (cn=*王*)
        (givenName=*王*)
        (sn=*王*)
        (mozillaNickname=*王*)
        (mail=*王*)
        (mozillaSecondEmail=*王*)
        (&
            (null=TRUE)
            (description=*王*)
        )
        (o=*王*)
        (ou=*王*)
        (title=*王*)
        (mozillaWorkUrl=*王*)
        (mozillaHomeUrl=*王*)
        (null=*王*)
        (null=*王*)
    )
)```

Ldap server log
```[03/Sep/2021:13:19:13.033318306 +0800] conn=5094 op=10 RESULT err=0 tag=101 nentries=1 wtime=0.000133907 optime=0.000174020 etime=0.000305324
[03/Sep/2021:13:19:24.669603850 +0800] conn=5094 op=12 SRCH base="dc=ds1,dc=mydomain,dc=com,dc=tw" scope=2 filter="(&(|(cn=*\E7\8E\8B*)(givenName=*\E7\8E\8B*)(sn=*\E7\8E\8B*)(mozillaNickname=*\E7\8E\8B*)(mail=*\E7\8E\8B*)(mozillaSecondEmail=*\E7\8E\8B*)(&(null=TRUE)(description=*\E7\8E\8B*))(o=*\E7\8E\8B*)(ou=*\E7\8E\8B*)(title=*\E7\8E\8B*)(mozillaWorkUrl=*\E7\8E\8B*)(mozillaHomeUrl=*\E7\8E\8B*)(null=*\E7\8E\8B*)(null=*\E7\8E\8B*)))" attrs="objectClass"
[03/Sep/2021:13:19:24.674232814 +0800] conn=5094 op=12 RESULT err=0 tag=101 nentries=8 wtime=0.000255632 optime=0.004630283 etime=0.004882239 notes=U details="Partially Unindexed Filter" - Invalid attribute in filter - results may not be complete.```

TB is encoding "王" into %E7%8E%8B, and Apache Directory Studio is \E7\8E\8B.
I think that made difference.

The queryString is percent encoded, decode it before parsing.

Assignee: nobody → remotenonsense
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Regressed by: ldap-js

Rob, if this doesn't land before you do the merge on Monday, can we get this as an uplift for your 93.0b1 build?

Flags: needinfo?(rob)

I'm building tomorrow, so hopefully it lands before then.

Blocks: tb91found

Please request uplift once this is reviewed and landed in comm-central.

Flags: needinfo?(rob)
Target Milestone: --- → 94 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/54f4e2c5d697
Fix searching ldap with Chinese character. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9239554 [details]
Bug 1728942 - Fix searching ldap with Chinese character. r=darktrojan

[Approval Request Comment]
Regression caused by (bug #): bug 1696625
User impact if declined: Searching ldap with Chinese characters doesn't work
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): low

Attachment #9239554 - Flags: approval-comm-esr91?
Attachment #9239554 - Flags: approval-comm-beta?

Comment on attachment 9239554 [details]
Bug 1728942 - Fix searching ldap with Chinese character. r=darktrojan

[Triage Comment]
Approved for beta

Attachment #9239554 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9239554 [details]
Bug 1728942 - Fix searching ldap with Chinese character. r=darktrojan

[Triage Comment]
Approved for esr91

Attachment #9239554 - Flags: approval-comm-esr91? → approval-comm-esr91+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: