PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser » Bug #1639

Error in foreach loop

Details

Submitted2004-06-14 23:44 UTC
Fromworthy at home dot olsztyn dot pl
Assignedarnaud
StatusClosed
PackageLiveUser
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-06-14 23:44 UTC] worthy at home dot olsztyn dot pl

Description:
------------
In file LiveUser/Admin/Auth/Containers/DB.php the foreach loop in line 191 and 311 generates a 'Invalid argument supplied ...' error when $this->authTableCols['custom'] is unset. In line 418 is correct.

Reproduce code:
---------------
line 191:
foreach ($this->authTableCols['custom'] as $alias => $field_data) {
$col[] = $field_data['name'];
$val[] = $this->dbc->quoteSmart($customFields[$alias]);
}

line 311:
foreach ($this->authTableCols['custom'] as $alias => $field_data) {
$updateValues[] = $field_data['name'] .
$this->dbc->quoteSmart($customFields[$alias]);
}

Expected result:
----------------
line 191:
if (sizeof($this->authTableCols['custom']) > 0) {
foreach ($this->authTableCols['custom'] as $alias => $field_data) {
$col[] = $field_data['name'];
$val[] = $this->dbc->quoteSmart($customFields[$alias]);
}
}

line 311:
if (sizeof($this->authTableCols['custom']) > 0) {
foreach ($this->authTableCols['custom'] as $alias => $field_data) {
$updateValues[] = $field_data['name'] .
$this->dbc->quoteSmart($customFields[$alias]);
}
}