diff options
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 4 | ||||
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/private/files/view.php | 1 | ||||
-rw-r--r-- | lib/private/image.php | 4 |
4 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 8d5b22dc283..02fcd7041dd 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -48,10 +48,10 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage { /** * get file cache of the shared item source - * @return string + * @return int */ public function getSourceId() { - return $this->share['file_source']; + return (int) $this->share['file_source']; } /** diff --git a/lib/base.php b/lib/base.php index cba5d4a4276..99c2764d22c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -699,6 +699,9 @@ class OC { if (!OC_User::isLoggedIn()) { // Test it the user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP + if (!OC_Config::getValue('maintenance', false) && !self::checkUpgrade(false)) { + OC_App::loadApps(array('authentication')); + } OC::tryBasicAuthLogin(); } diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 2a28e6fce88..6749fcd55d2 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -1182,6 +1182,7 @@ class View { * @return string|null */ public function getPath($id) { + $id = (int) $id; $manager = Filesystem::getMountManager(); $mounts = $manager->findIn($this->fakeRoot); $mounts[] = $manager->find($this->fakeRoot); diff --git a/lib/private/image.php b/lib/private/image.php index 0dff8c5a9da..7ddc8dca143 100644 --- a/lib/private/image.php +++ b/lib/private/image.php @@ -603,6 +603,7 @@ class OC_Image { $meta = unpack('vtype/Vfilesize/Vreserved/Voffset', fread($fh, 14)); // check for bitmap if ($meta['type'] != 19778) { + fclose($fh); trigger_error('imagecreatefrombmp: ' . $fileName . ' is not a bitmap!', E_USER_WARNING); return false; } @@ -626,6 +627,7 @@ class OC_Image { if ($meta['imagesize'] < 1) { $meta['imagesize'] = @filesize($fileName) - $meta['offset']; if ($meta['imagesize'] < 1) { + fclose($fh); trigger_error('imagecreatefrombmp: Can not obtain filesize of ' . $fileName . '!', E_USER_WARNING); return false; } @@ -666,6 +668,7 @@ class OC_Image { break; case 16: if (!($part = substr($data, $p, 2))) { + fclose($fh); trigger_error($error, E_USER_WARNING); return $im; } @@ -712,6 +715,7 @@ class OC_Image { $color[1] = $palette[ $color[1] + 1 ]; break; default: + fclose($fh); trigger_error('imagecreatefrombmp: ' . $fileName . ' has ' . $meta['bits'] . ' bits and this is not supported!', E_USER_WARNING); |