#107 Undefined variable in addressbook.php

closed-fixed
nobody
None
5
2005-11-21
2005-11-09
No

In functions/addressbook.php we have this function

function lookup($alias, $bnum = -1) {
$ret = array();
if ($bnum > -1) {
$res = $this->backends[$bnum]->lookup($alias);
if (is_array($res)) {
return $res;
} else {
$this->error =
htmlspecialchars($backend->error);
return false;
}
}

$sel = $this->get_backend_list('local');
for ($i = 0 ; $i < sizeof($sel) ; $i++) {
$backend = &$sel[$i];
$backend->error = '';
$res = $backend->lookup($alias);
if (is_array($res)) {
if(!empty($res))
return $res;
} else {
$this->error =
htmlspecialchars($backend->error);
return false;
}
}
return $ret;
}

The only issue is in the first line
$this->error =
htmlspecialchars($backend->error);
the variable $backend is undefined at that point.

Discussion

  • Thijs Kinkhorst

    Thijs Kinkhorst - 2005-11-21
    • status: open --> closed-fixed
     
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2005-11-21

    Logged In: YES
    user_id=285765

    Fixed in stable & devel cvs, thanks!

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks