Skip to content

Commit ad6a834

Browse files
committed
fix looking up the owner
1 parent 2edba71 commit ad6a834

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/User.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)