Skip to content

Resolve "Newlines in custom server hook error messages render improperly in merge UI"

What does this MR do?

This MR fixes a bug where sending two errors in a custom server hook would show a <br> to separate the two lines instead of an actual linebreak.

Related to #284640 (closed)

Pre-receive hook used

#!/bin/sh

echo "GL-HOOK-ERR: User is ${GL_ID}"
# HTML will be escaped (on the backend)
echo "GL-HOOK-ERR: Do better. <b>hi!</b>"
exit 1

Screenshots (strongly suggested)

Before After
image image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Kev

Merge request reports