Escape commit message from XSS and broken markup.

Closes #769
This commit is contained in:
Alex Davyskiba 2015-01-31 11:23:29 +02:00 committed by Dan Cryer
parent bad53fe51b
commit 46aae66700
2 changed files with 8 additions and 1 deletions

View file

@ -193,4 +193,11 @@ class Build extends BuildBase
return $rtn;
}
public function getCommitMessage()
{
$rtn = htmlspecialchars($this->data['commit_message']);
return $rtn;
}
}

View file

@ -101,7 +101,7 @@ class GithubBuild extends RemoteGitBuild
*/
public function getCommitMessage()
{
$rtn = $this->data['commit_message'];
$rtn = parent::getCommitMessage($this->data['commit_message']);
$reference = $this->getProject()->getReference();
$commitLink = '<a target="_blank" href="https://github.com/' . $reference . '/issues/$1">#$1</a>';