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

If contact_id divisible by 100, contact cannot be displayed #4211

Closed
rcubetrac opened this issue May 23, 2013 · 2 comments
Closed

If contact_id divisible by 100, contact cannot be displayed #4211

rcubetrac opened this issue May 23, 2013 · 2 comments

Comments

@rcubetrac
Copy link

Reported by vitek on 23 May 2013 15:33 UTC as Trac ticket #1489121

When the contact has contact_id divisible by 100 in contacts table, it is not possible to display the contact (you will receive an error about nonexistent contact or different contact is displayed). When you go to addressbook and you choose the group, you can see the contact (in the column Contacts), but when you click on it, you will receive the error message or different contact.

In program/steps/addressbook/func.inc there is a definition of a function rcmail_get_cids(). It contains these lines:

if (substr($id, -($got_source+1)) == "-$source") {
    $id = substr($id, 0, -($got_source+1));
}

In my case variable $source contains 0, variable $got_source contains 1 and when $id is divisible by 100, then you have "00" on the left side of the comparission. On the right side you have "-0". I dont exactly understand why those strings are equal ("00" and "-0"), they are probably for some reason converted to integer and then they are equal. After the condition succeeds, $id looses too digits from right (divided by 100) and the resulting cid is different so you will receive information about different contact (whose contact_id is original contact_id divided by 100) or you get an error message that contact doesnt exist.

Migrated-From: http://trac.roundcube.net/ticket/1489121

@rcubetrac
Copy link
Author

Comment by @alecpl on 23 May 2013 16:26 UTC

Fixed in 6ae92aa

@rcubetrac
Copy link
Author

Status changed by @alecpl on 23 May 2013 16:26 UTC

new => closed

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

1 participant