Skip to content

Commit edd77fc

Browse files
committed
catch pipe chars in user names; fixes #339
1 parent cb84ba7 commit edd77fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

okapi/services/users/by_username.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ public static function call(OkapiRequest $request)
2727
{
2828
$username = $request->get_parameter('username');
2929
if (!$username) throw new ParamMissing('username');
30+
31+
# Fix for issue 339:
32+
# Catch pipe chars here, because services/users/by_usernames would split up the name.
33+
# OC databases do not contain user names with pipe chars.
34+
35+
if (strstr($username,'|'))
36+
throw new InvalidParam('username', "There is no user by this username.");
3037
$fields = $request->get_parameter('fields');
3138

3239
# There's no need to validate the fields parameter.

0 commit comments

Comments
 (0)