PaulB
Well-known member
- Affected version
- 1.5.21
Searching for a user results in a dropdown in several places (/members/, @-tags, /admin.php?users/). This results in a JSON response, in the form:
Both the avatar and username fields are escaped with htmlspecialchars; for the former, this occurs in the helperAvatarUrl method. However, when the URL is set for the avatar image in JavaScript, the URL is taken verbatim, so the entities are never decoded by the browser. This results in invalid URLs, particularly for Gravatar if more than one querystring parameter is set, which occurs under normal circumstances.
Code:
{
"results": [
{
"avatar": "...",
"username": "..."
},
...
]
}
Both the avatar and username fields are escaped with htmlspecialchars; for the former, this occurs in the helperAvatarUrl method. However, when the URL is set for the avatar image in JavaScript, the URL is taken verbatim, so the entities are never decoded by the browser. This results in invalid URLs, particularly for Gravatar if more than one querystring parameter is set, which occurs under normal circumstances.