IBM Connections Directory Search breaks when User have quotes in a profile field

· by Christoph Stoettner · Read in about 2 min · (372 words)

On one of my IBM Connections Site i had a problem with directory search (better the typeahead search). When we searched single characters no business cards are displayed.

2012 03 19 13 18 11

I use Firebug for Chrome here and you see, that the search gets an result back from Connections, but no business cards are displayed.

When i open this get statement i get a list of profile documents in JSON format:

2012 03 19 13 23 48

In this case i a got a list of about 20 User profiles. When i search a little bit more detailed i get an error of a Javascript, which should interpret the JSON list. Thanks to the developer (I think it is a dojo script)! “There was an error!” is a great response for troubleshooting and searching the error on Google or Bing!

2012 03 19 13 26 01

The list has following format:

         "name":"John Doe",
            "mobileNumber":"+49 (123) 12 34 567",
            "faxNumber":"+49 (123) 456789",
            "bldgId":"Member of "Android Lovers"",
            "displayName":"John Doe",
            "telephoneNumber":"+49 (1234) 56789",
            "distinguishedName":"CN=John Doe,OU=Admin,OU=DE,O=STOEPS",
            "lastUpdate":"2012-03-05 14:23:34.504"

Problem here is the field bldgId: "Member of "Android Lovers"".

You can see double ” which are not masked. Our IBM Connections User can fill nearly everything in the fields in Profiles, but get no warning if he uses quotes and quotes are not masked, when they are stored in the database.

So when you have on user who uses quotes in one of his Profile fields, the typeahead search displays no results for character searches which contains this user (and no error message).

Finding such fields with regular expressions

I tested the typeahead search on all characters and copied the result of the GET statement out of Firebug and developed a regexp to find double quoted strings:

:\"\"[a-zA-Z0-9\.\/\+\-\:\s äöüÄÖÜ]\"

On Mac OS X you can use RegExRX or Notepad++ on Windows to test this regexp and you will get the wrong field values.

TDI and Typeahead

You can see in the result list, that TDI Search Urls are saved in each profile document too! "sourceUrl":"ldap://ldapserver:389/(undefined=search_base)?(&(ObjectClass=*)(Attribute=1))", so please be careful, when you configure your search strings, because a double quoted attribute breaks typeahead search too!