Commit eab8a13b authored by Dries's avatar Dries

- Patch #341910 by mayer: make file_space_used work on PostgreSQL.

parent dc82bc5a
......@@ -771,9 +771,9 @@ function file_unmanaged_delete($path) {
*/
function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) {
if (!is_null($uid)) {
return db_query('SELECT SUM(filesize) FROM {files} WHERE uid = :uid AND status & :status', array(':uid' => $uid, ':status' => $status))->fetchField();
return db_query('SELECT SUM(filesize) FROM {files} WHERE uid = :uid AND status = :status', array(':uid' => $uid, ':status' => $status))->fetchField();
}
return db_query('SELECT SUM(filesize) FROM {files} WHERE status & :status', array(':status' => $status))->fetchField();
return db_query('SELECT SUM(filesize) FROM {files} WHERE status = :status', array(':status' => $status))->fetchField();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment