minor fixes (prevention of warnings)

This commit is contained in:
tomash 2006-11-03 21:07:06 +00:00
parent b8d5f8d035
commit 42891b2059

View file

@ -193,10 +193,11 @@ class StoredFile {
return $row; return $row;
} }
if (is_null($row)) { if (is_null($row)) {
return PEAR::raiseError( $r =& PEAR::raiseError(
"StoredFile::recall: fileobj not exist ($oid/$gunid)", "StoredFile::recall: fileobj not exist ($oid/$gunid)",
GBERR_FOBJNEX GBERR_FOBJNEX
); );
return $r;
} }
$gunid = StoredFile::_normalizeGunid($row['gunid']); $gunid = StoredFile::_normalizeGunid($row['gunid']);
$ac =& new $className($gb, $gunid); $ac =& new $className($gb, $gunid);
@ -511,6 +512,9 @@ class StoredFile {
*/ */
function setMime($mime) function setMime($mime)
{ {
if ( !is_string($mime)){
$mime = 'application/octet-stream';
}
$escapedMime = pg_escape_string($mime); $escapedMime = pg_escape_string($mime);
$res = $this->dbc->query(" $res = $this->dbc->query("
UPDATE {$this->filesTable} SET mime='$escapedMime', mtime=now() UPDATE {$this->filesTable} SET mime='$escapedMime', mtime=now()