File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,10 +84,16 @@ public static function getFileSystem() {
8484 if (!self ::storageIdExists ($ storageId )) {
8585 throw new \Exception ("Storage does not exist " );
8686 }
87+ if (is_dir (STORAGEBASE . "$ storageId/ " )) { // backwards compatiblity check
88+ $ storagePath = $ storageId ;
89+ } else {
90+ $ storagePath = implode ("/ " , str_split ($ storageId , 4 ));
91+ }
92+
8793 // The internal adapter
8894 $ adapter = new \League \Flysystem \Adapter \Local (
8995 // Determine root directory
90- STORAGEBASE . "$ storageId / "
96+ STORAGEBASE . "$ storagePath / "
9197 );
9298
9399 $ graph = new \EasyRdf \Graph ();
Original file line number Diff line number Diff line change @@ -269,11 +269,13 @@ public static function getUserById($userId) {
269269 }
270270
271271 public static function getUserByWebId ($ webId ) {
272- $ idParts = explode (". " , $ webId , 2 );
273- if ($ idParts [1 ] !== BASEDOMAIN . "/#me " ) {
272+ $ webIdParts = parse_url ($ webId );
273+ $ idParts = explode (". " , $ webIdParts ['host ' ], 2 );
274+ if ($ idParts [1 ] !== BASEDOMAIN ) {
274275 return false ;
275276 }
276- $ userId = preg_replace ("/^id-/ " , "" , $ idParts [0 ]);
277+ $ userId = preg_replace ("/^.*?id-/ " , "" , $ idParts [0 ]);
278+
277279 return self ::getUserById ($ userId );
278280 }
279281
You can’t perform that action at this time.
0 commit comments