Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.2.0
-
Fix Version/s: 1.2.1
-
Component/s: None
-
Labels:None
Description
Fetch column method looks like this:
public function fetchColumn($columnIndex = 0)
{
if ( ! is_integer($columnIndex)) {
$this->handleError(array('message'=>"columnIndex parameter should be numeric"));
}
$row = $this->fetch(Doctrine_Core::FETCH_NUM);
return $row[$columnIndex];
}
Method handleError() not always throws an exception, and by passing it a string or any other variable type than integer will result in warning.
Fix (depending on what is considered to be required by interface):
if ( ! is_integer($columnIndex)) {
$this->handleError(array('message'=>"columnIndex parameter should be numeric"));
return false;
}
or
if ( ! is_integer($columnIndex)) {
throw new Doctrine_Adapter_Exception("columnIndex parameter should be numeric");
}
Fixed code comments