6.0.0-beta1
7/5/25

[#8533] Net_IMSP abook contacts with leading/trailing space in name break turba browsing
Summary Net_IMSP abook contacts with leading/trailing space in name break turba browsing
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester noah (at) lsit (dot) ucsb (dot) edu
Created 08/27/2009 (5791 days ago)
Due
Updated 10/01/2009 (5756 days ago)
Assigned 08/28/2009 (5790 days ago)
Resolved 10/01/2009 (5756 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
10/01/2009 11:45:15 PM Michael Rubinsky Comment #3
State ⇒ Resolved
Reply to this comment
Committed and merged to FW_3, thanks!
10/01/2009 11:43:47 PM CVS Commit Comment #2 Reply to this comment
Changes have been made in CVS for this ticket:

Don't trim ws from data rec'd as a stream
Bug: 8533
Submitted by: noah (at) lsit (dot) ucsb (dot) edu
http://cvs.horde.org/diff.php/framework/Net_IMSP/IMSP.php?rt=horde&r1=1.42&r2=1.43&ty=u
http://cvs.horde.org/diff.php/framework/Net_IMSP/IMSP/Book.php?rt=horde&r1=1.48&r2=1.49&ty=u
08/28/2009 08:57:45 AM Jan Schneider State ⇒ Assigned
Assigned to Michael Rubinsky
 
08/27/2009 11:38:48 PM noah (at) lsit (dot) ucsb (dot) edu Comment #1
Priority ⇒ 1. Low
New Attachment: IMSP-fix-trims.patch Download
Patch ⇒ Yes
Milestone ⇒
Summary ⇒ Net_IMSP abook contacts with leading/trailing space in name break turba browsing
Type ⇒ Bug
State ⇒ Unconfirmed
Queue ⇒ Horde Framework Packages
Reply to this comment
Although Turba properly prevents address book contacts from being 
created with names containing leading/trailing space, we have other 
IMSP clients on our network that lack this restriction. Any IMSP 
address book containing one of these contacts becomes unbrowseable in 
Turba, and the contacts don't show up during name expansion search in 
IMP.



I've traced the problems we were having to two locations, the first is 
the receiveStringLiteral function in IMSP.php. It trims the received 
literal from fread. I don't think that makes sense. Seems like the 
literal value should be treated as such, including any extraneous 
space it may have. This was breaking searchaddress/fetchaddress 
coherence for UTF-8 contact names w/ leading or trailing whitespace.



The second is the search function in IMSP/Book.php.  Around line 250   
it strips double quote characters, and then trims leading whitespace. 
Inverting the order of those two operations fixes contact names with 
leading whitespace. (Trim space on the left of the double quote, then 
remove the quote, rather than potentially catching leading spaces from 
the quoted string.) This was breaking contact search/fetch for contact 
names w/ leading whitespace.



Fixing those two locations in the code brings back browse capability & 
name expansion, however, loading a detail or edit view in Turba for 
the contacts named with extraneous spaces is still broken (standard 
server NO response). The value's getting trimmed somewhere before 
being encoded in the view link.



I consider my current fix 'adequate', or 'a start,' but it would be 
nice if more of the Turba interface worked with these contacts.



Patch against HEAD for IMSP.php and Book.php provided.



Test environment: cyrus imspd server, php 5.2.x, apache 2.2.x

Saved Queries