minor fixes (prevention of warnings)
This commit is contained in:
parent
b8d5f8d035
commit
42891b2059
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue