diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-06-02 11:02:15 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-06-02 11:02:15 +0200 |
commit | f23bdde464ef20ad2ffcb3984cc9481955374809 (patch) | |
tree | 5f1d46f3f513ecf2d788b842c0dd01cbd9ac1a99 /Zotlabs/Storage | |
parent | c1039977f1d64611d2c793f3aded96d031b74183 (diff) | |
parent | 05d9e1bee565ac0448c779a00d8d637341390cf7 (diff) | |
download | volse-hubzilla-f23bdde464ef20ad2ffcb3984cc9481955374809.tar.gz volse-hubzilla-f23bdde464ef20ad2ffcb3984cc9481955374809.tar.bz2 volse-hubzilla-f23bdde464ef20ad2ffcb3984cc9481955374809.zip |
Merge branch 'dev' into sabre32
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r-- | Zotlabs/Storage/Directory.php | 2 | ||||
-rw-r--r-- | Zotlabs/Storage/File.php | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php index 84368d07e..06ae90a5f 100644 --- a/Zotlabs/Storage/Directory.php +++ b/Zotlabs/Storage/Directory.php @@ -246,7 +246,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { $deny_gid = $c[0]['channel_deny_gid']; } - $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, folder, os_storage, filetype, filesize, revision, is_photo, data, created, edited, allow_cid, allow_gid, deny_cid, deny_gid ) + $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, folder, os_storage, filetype, filesize, revision, is_photo, content, created, edited, allow_cid, allow_gid, deny_cid, deny_gid ) VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ", intval($c[0]['channel_account_id']), intval($c[0]['channel_id']), diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index d40fee0ea..ecd15cc55 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -124,7 +124,7 @@ class File extends DAV\Node implements DAV\IFile { ); if ($r) { if (intval($r[0]['os_storage'])) { - $d = q("select folder, data from attach where hash = '%s' and uid = %d limit 1", + $d = q("select folder, content from attach where hash = '%s' and uid = %d limit 1", dbesc($this->data['hash']), intval($c[0]['channel_id']) ); @@ -139,7 +139,7 @@ class File extends DAV\Node implements DAV\IFile { $direct = $f1[0]; } } - $fname = dbunescbin($d[0]['data']); + $fname = dbunescbin($d[0]['content']); if(strpos($fname,'store') === false) $f = 'store/' . $this->auth->owner_nick . '/' . $fname ; else @@ -158,12 +158,12 @@ class File extends DAV\Node implements DAV\IFile { } else { // this shouldn't happen any more - $r = q("UPDATE attach SET data = '%s' WHERE hash = '%s' AND uid = %d", + $r = q("UPDATE attach SET content = '%s' WHERE hash = '%s' AND uid = %d", dbescbin(stream_get_contents($data)), dbesc($this->data['hash']), intval($this->data['uid']) ); - $r = q("SELECT length(data) AS fsize FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1", + $r = q("SELECT length(content) AS fsize FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1", dbesc($this->data['hash']), intval($this->data['uid']) ); @@ -236,7 +236,7 @@ class File extends DAV\Node implements DAV\IFile { logger('get file ' . basename($this->name), LOGGER_DEBUG); logger('os_path: ' . $this->os_path, LOGGER_DATA); - $r = q("SELECT data, flags, os_storage, filename, filetype FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1", + $r = q("SELECT content, flags, os_storage, filename, filetype FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1", dbesc($this->data['hash']), intval($this->data['uid']) ); @@ -250,14 +250,14 @@ class File extends DAV\Node implements DAV\IFile { } if (intval($r[0]['os_storage'])) { - $x = dbunescbin($r[0]['data']); + $x = dbunescbin($r[0]['content']); if(strpos($x,'store') === false) $f = 'store/' . $this->auth->owner_nick . '/' . (($this->os_path) ? $this->os_path . '/' : '') . $x; else $f = $x; return fopen($f, 'rb'); } - return dbunescbin($r[0]['data']); + return dbunescbin($r[0]['content']); } } |