]> git.mxchange.org Git - friendica.git/commitdiff
dbg info for photo uploads
authorFriendika <info@friendika.com>
Wed, 29 Jun 2011 01:59:41 +0000 (18:59 -0700)
committerFriendika <info@friendika.com>
Wed, 29 Jun 2011 01:59:41 +0000 (18:59 -0700)
boot.php
mod/photos.php

index 5f4820b4f17c3f47aba86e9e8717bcdcfde6924f..54206d7fe4300d292f78df4fc64ff494d26df286 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -4,7 +4,7 @@ set_time_limit(0);
 ini_set('pcre.backtrack_limit', 250000);
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1024' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1025' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1070      );
 
index bbdb8b7e9ecaef43598aff9c1d611732af929f8e..28ed609b58078e9b0ecf2c6bf59cb1dc7f1ef267 100644 (file)
@@ -590,6 +590,9 @@ function photos_post(&$a) {
                $filesize   = intval($_FILES['userfile']['size']);
        }
 
+
+       logger('photos: upload: received file: ' . $filename . ' as ' . $src . ' ' . $filesize . ' bytes', LOGGER_DEBUG);
+
        $maximagesize = get_config('system','maximagesize');
 
        if(($maximagesize) && ($filesize > $maximagesize)) {
@@ -600,6 +603,14 @@ function photos_post(&$a) {
                return;
        }
 
+       if(! $filesize) {
+               notice( t('Image file is empty.') . EOL);
+               @unlink($src);
+               $foo = 0;
+               call_hooks('photo_post_end',$foo);
+               return;
+       }
+
        logger('mod/photos.php: photos_post(): loading the contents of ' . $src , 'LOGGER_DEBUG');
 
        $imagedata = @file_get_contents($src);