the buddylist links in the userprofile are quite strange and do not work (drupal cvs, buddylist cvs):

http://yourwebsite.com/buddy/add/2?destination=user/2
http://yourwebsite.com/buddy/add/16?destination=user/16

the code in the install.txt (template.php) generates more strange links.

http://yourwebsite.com/buddy/add/16?destination=node

Comments

kus’s picture

http://starfrosch.ch/1/buddy/add/33?destination=user%2F33

this adds user 3 to buddylist, instead of user 33...

kus’s picture

i don't get the idea why you $uid = (int)$uid[0] ....this returns only the first number of the userid...uncommenting helps.


function buddylist_addbuddy($uid) {
global $user;
// $uid = (int)$uid[0];
$buddy = user_load(array('uid' => $uid));

robertdouglass’s picture

Status: Active » Fixed

I don't know what you mean in your first comment about the weird links. The issue of add/33 adding "3" has been fixed in the latest for 4-7.

alliax’s picture

why not fixing it in deletebuddies function too? If it needs an issue opened by bug, this module will never be completed! :-)

in deletebuddies function there's still

function buddylist_deletebuddy($uid) {
  global $user;
  $uid = (int)$uid[0];

So I'm removing [0] now.. please do it too on the cvs

robertdouglass’s picture

Status: Fixed » Needs review

There was all sorts of cruft pertaining to $uid in arrays. I think I've rooted it all out now... would appreciate a bit of testing. (no patch, has been committed)

quicksketch’s picture

Status: Needs review » Closed (fixed)

I haven't found any problems (PHP4 or PHP5). There is no longer any typecasting at all in these functions, since it was mainly a problem that began with passing in incorrect input.