Revision 13696
Added by Aaron Marcuse-Kubitza over 10 years ago
username_prefix.php | ||
---|---|---|
8 | 8 |
function user2path($user) # multiple @ and nested . OK: a@b.c@url -> url?b.c.a |
9 | 9 |
{ |
10 | 10 |
# remove padding used to visually separate 1st element: _x_@url -> x@url |
11 |
$user = preg_replace('/^_*([^@]*?)_*(?=@|$)/', '$1', $user); |
|
11 |
# supports embedded @ inside highlighted part: _x@y_@url |
|
12 |
$user = preg_replace('/^_*(.*?)_*(?=@|$)/', '$1', $user); |
|
12 | 13 |
# translate reverse @-paths into forward .-paths |
13 | 14 |
return implode(".", array_reverse(explode("@", $user))); |
14 | 15 |
} |
Also available in: Unified diff
web/username_prefix.php: user2path(): padding used to visually separate 1st element of URL: support embedded @ inside highlighted part