Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/StorageServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,16 @@ public static function getFileSystem() {
if (!self::storageIdExists($storageId)) {
throw new \Exception("Storage does not exist");
}
if (is_dir(STORAGEBASE . "$storageId/")) { // backwards compatiblity check
$storagePath = $storageId;
} else {
$storagePath = implode("/", str_split($storageId, 4));
}

// The internal adapter
$adapter = new \League\Flysystem\Adapter\Local(
// Determine root directory
STORAGEBASE . "$storageId/"
STORAGEBASE . "$storagePath/"
);

$graph = new \EasyRdf\Graph();
Expand Down
8 changes: 5 additions & 3 deletions lib/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,13 @@ public static function getUserById($userId) {
}

public static function getUserByWebId($webId) {
$idParts = explode(".", $webId, 2);
if ($idParts[1] !== BASEDOMAIN . "/#me") {
$webIdParts = parse_url($webId);
$idParts = explode(".", $webIdParts['host'], 2);
if ($idParts[1] !== BASEDOMAIN) {
return false;
}
$userId = preg_replace("/^id-/", "", $idParts[0]);
$userId = preg_replace("/^.*?id-/", "", $idParts[0]);

return self::getUserById($userId);
}

Expand Down
Loading