mirror of
https://github.com/humhub/humhub.git
synced 2025-03-15 04:29:45 +01:00
Fixed broken notification links to user profiles when url rewriting is enabled.
This commit is contained in:
parent
7857de5010
commit
fd0933ea95
@ -45,7 +45,7 @@ class UserUrlRule extends CBaseUrlRule
|
||||
|
||||
unset($params['uguid']);
|
||||
if ($route == 'user/profile') {
|
||||
$route = "";
|
||||
$route = "home";
|
||||
}
|
||||
|
||||
$url = "u/" . urlencode(strtolower($userName)) . "/" . $route;
|
||||
@ -61,16 +61,15 @@ class UserUrlRule extends CBaseUrlRule
|
||||
if (substr($pathInfo, 0, 2) == "u/") {
|
||||
$parts = explode('/', $pathInfo, 3);
|
||||
if (isset($parts[1])) {
|
||||
#$space = Space::model()->findByPk($parts[1]);
|
||||
#$user = User::model()->findByAttributes(array('guid' => $parts[1]));
|
||||
|
||||
$user = User::model()->findByAttributes(array('username' => $parts[1]));
|
||||
|
||||
if ($user !== null) {
|
||||
$_GET['uguid'] = $user->guid;
|
||||
if (isset($parts[2])) {
|
||||
return $parts[2];
|
||||
} else {
|
||||
if (!isset($parts[2]) || substr($parts[2], 0, 4) == 'home') {
|
||||
return 'user/profile';
|
||||
} else {
|
||||
return $parts[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user