aboutsummaryrefslogtreecommitdiffstats
path: root/include/RedDAV
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-13 15:02:51 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-13 15:02:51 -0700
commit3f0009ccd7fb96e8808b3267367ae95ffee37161 (patch)
tree560fdc784069b6cf07af82d1f612e64dacca9390 /include/RedDAV
parente838647e3aa87c36a494375c502e98788f209d19 (diff)
parent8c4c0246f012a57816ebf3f8bef9510f4e89e98f (diff)
downloadvolse-hubzilla-3f0009ccd7fb96e8808b3267367ae95ffee37161.tar.gz
volse-hubzilla-3f0009ccd7fb96e8808b3267367ae95ffee37161.tar.bz2
volse-hubzilla-3f0009ccd7fb96e8808b3267367ae95ffee37161.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts: util/messages.po
Diffstat (limited to 'include/RedDAV')
-rw-r--r--include/RedDAV/RedDirectory.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/RedDAV/RedDirectory.php b/include/RedDAV/RedDirectory.php
index 922be378d..005d81c75 100644
--- a/include/RedDAV/RedDirectory.php
+++ b/include/RedDAV/RedDirectory.php
@@ -213,8 +213,15 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
$filesize = 0;
$hash = random_string();
- $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, folder, flags, filetype, filesize, revision, data, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
+ $is_photo = 0;
+ $x = @getimagesize($src);
+ logger('getimagesize: ' . print_r($x,true), LOGGER_DATA);
+ if(($x) && ($x[2] === IMAGETYPE_GIF || $x[2] === IMAGETYPE_JPEG || $x[2] === IMAGETYPE_PNG)) {
+ $is_photo = 1;
+ }
+
+ $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, folder, flags, filetype, filesize, revision, is_photo, data, 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']),
dbesc($hash),
@@ -225,6 +232,7 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
dbesc($mimetype),
intval($filesize),
intval(0),
+ intval($is_photo),
dbesc($this->os_path . '/' . $hash),
dbesc(datetime_convert()),
dbesc(datetime_convert()),