diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 8d5b22dc2834b469a5ded592db59cdca906c4667..02fcd7041dd04f6787eac0a64b1a3c36b9edf566 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/private/files/view.php b/lib/private/files/view.php
index 2a28e6fce881a794c9b4650c3ed632a46845471f..6749fcd55d2307234b6bc53f4e7e2e591b05bd02 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);