Skip to content

Commit

Permalink
Adding htmlentities() to all parameters passed into the HtmlReporter.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 23, 2010
1 parent 813a3af commit c404ae5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cake/tests/lib/reporter/cake_html_reporter.php
Expand Up @@ -27,7 +27,17 @@
* @subpackage cake.tests.lib * @subpackage cake.tests.lib
*/ */
class CakeHtmlReporter extends CakeBaseReporter { class CakeHtmlReporter extends CakeBaseReporter {

/**
* Constructor
*
* @param string $charset
* @param string $params
* @return void
*/
function CakeHtmlReporter($charset = 'utf-8', $params = array()) {
$params = array_map(array($this, '_htmlEntities'), $params);
$this->CakeBaseReporter($charset, $params);
}
/** /**
* Paints the top of the web page setting the * Paints the top of the web page setting the
* title to the name of the starting test. * title to the name of the starting test.
Expand All @@ -40,7 +50,7 @@ function paintHeader($testName) {
$this->sendNoCacheHeaders(); $this->sendNoCacheHeaders();
$this->paintDocumentStart(); $this->paintDocumentStart();
$this->paintTestMenu(); $this->paintTestMenu();
echo "<h2>$testName</h2>\n"; printf("<h2>%s</h2>\n", $this->_htmlEntities($testName));
echo "<ul class='tests'>\n"; echo "<ul class='tests'>\n";
} }


Expand Down

0 comments on commit c404ae5

Please sign in to comment.