diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-11-24 14:19:22 +0100 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-11-24 14:19:22 +0100 |
commit | bef8879cb1356b880279c6104fcffb0752414a7c (patch) | |
tree | ce3733df7ca168f4afe7e963dc81b6f00944c34c /include/RedDAV/RedFile.php | |
parent | 1cb45c30e9032794b7827738cc28f7728ac28677 (diff) | |
parent | 5b7124f0daeca4aa619f6411ee373d9ff5a22b7b (diff) | |
download | volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.gz volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.bz2 volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.zip |
Merge pull request #7 from friendica/master
Merge from main project
Diffstat (limited to 'include/RedDAV/RedFile.php')
-rw-r--r-- | include/RedDAV/RedFile.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/RedDAV/RedFile.php b/include/RedDAV/RedFile.php index f96790631..3a5230dc1 100644 --- a/include/RedDAV/RedFile.php +++ b/include/RedDAV/RedFile.php @@ -79,7 +79,7 @@ class RedFile extends DAV\Node implements DAV\IFile { $newName = str_replace('/', '%2F', $newName); - $r = q("UPDATE attach SET filename = '%s' WHERE hash = '%s' AND id = %d LIMIT 1", + $r = q("UPDATE attach SET filename = '%s' WHERE hash = '%s' AND id = %d", dbesc($this->data['filename']), intval($this->data['id']) ); @@ -96,7 +96,7 @@ class RedFile extends DAV\Node implements DAV\IFile { $size = 0; // @todo only 3 values are needed - $c = q("SELECT * FROM channel WHERE channel_id = %d AND NOT (channel_pageflags & %d) LIMIT 1", + $c = q("SELECT * FROM channel WHERE channel_id = %d AND NOT (channel_pageflags & %d)>0 LIMIT 1", intval($this->auth->owner_id), intval(PAGE_REMOVED) ); @@ -113,7 +113,7 @@ class RedFile extends DAV\Node implements DAV\IFile { $size = @filesize($f); logger('filename: ' . $f . ' size: ' . $size, LOGGER_DEBUG); } else { - $r = q("UPDATE attach SET data = '%s' WHERE hash = '%s' AND uid = %d LIMIT 1", + $r = q("UPDATE attach SET data = '%s' WHERE hash = '%s' AND uid = %d", dbesc(stream_get_contents($data)), dbesc($this->data['hash']), intval($this->data['uid']) @@ -131,7 +131,7 @@ class RedFile extends DAV\Node implements DAV\IFile { // returns now() $edited = datetime_convert(); - $d = q("UPDATE attach SET filesize = '%s', edited = '%s' WHERE hash = '%s' AND uid = %d LIMIT 1", + $d = q("UPDATE attach SET filesize = '%s', edited = '%s' WHERE hash = '%s' AND uid = %d", dbesc($size), dbesc($edited), dbesc($this->data['hash']), @@ -139,7 +139,7 @@ class RedFile extends DAV\Node implements DAV\IFile { ); // update the folder's lastmodified timestamp - $e = q("UPDATE attach SET edited = '%s' WHERE hash = '%s' AND uid = %d LIMIT 1", + $e = q("UPDATE attach SET edited = '%s' WHERE hash = '%s' AND uid = %d", dbesc($edited), dbesc($r[0]['folder']), intval($c[0]['channel_id']) |