Commit b6175173 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Report.php: set default value for $t3data["uid"]. $bodyText now given to...

Report.php: set default value for $t3data["uid"]. $bodyText now given to process() instead of the constructor - makes testing easier.
QuickFormQuery.php: applied change of 'bodytext' from Report.php.
parent cd89614a
......@@ -535,7 +535,7 @@ class QuickFormQuery {
private function doReport() {
$report = new Report($this->t3data, $this->store->getVar(SYSTEM_SESSION_NAME, STORE_SYSTEM), $this->eval, $this->phpUnit);
$html = $report->process();
$html = $report->process($this->t3data['bodytext']);
return $html;
......
......@@ -94,6 +94,8 @@ class Report {
$this->phpUnit = $phpUnit;
Support::setIfNotSet($t3data, "uid", 0);
$this->t3data = $t3data;
$this->sip = new Sip($sessionName, $phpUnit);
$this->store = Store::getInstance();
......@@ -119,7 +121,7 @@ class Report {
// Set static values, which won't change during this run.
$this->fr_error["pid"] = isset($this->variables->resultArray['global.']['page_id']) ? $this->variables->resultArray['global.']['page_id'] : 0;
$this->fr_error["uid"] = $t3data["uid"];
$this->fr_error["uid"] = $t3data['uid'];
$this->fr_error["debug_level"] = 0;
// Sanitize function for POST and GET Parameters.
......@@ -138,12 +140,12 @@ class Report {
*
* @return string
*/
public function process() {
public function process($bodyText) {
$this->log->set_fr_error($this->fr_error);
// Iteration over Bodytext
$ttLineArray = explode("\n", $this->t3data['bodytext']);
$ttLineArray = explode("\n", $bodyText);
foreach ($ttLineArray as $index => $line) {
// Fill $frArray, $indexArray, $resultArray
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment