This commit is contained in:
wangyidong
2019-09-24 09:17:49 +08:00
parent a3ba864944
commit e41a21b408
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -1103,8 +1103,8 @@ class testcaseModel extends model
if(empty($desc)) continue;
$step = new stdclass();
$step->type = $data->stepType[$key][$id];
$step->desc = $desc;
$step->expect = trim($this->post->expect[$key][$id]);
$step->desc = htmlspecialchars($desc);
$step->expect = htmlspecialchars(trim($this->post->expect[$key][$id]));
$steps[] = $step;
}
@@ -1152,7 +1152,7 @@ class testcaseModel extends model
$stepData->parent = ($stepData->type == 'item') ? $parentStepID : 0;
$stepData->case = $caseID;
$stepData->version = $version;
$stepData->desc = $step['desc'];
$stepData->desc = htmlspecialchars($step['desc']);
$stepData->expect = htmlspecialchars($step['expect']);
$this->dao->insert(TABLE_CASESTEP)->data($stepData)->autoCheck()->exec();
if($stepData->type == 'group') $parentStepID = $this->dao->lastInsertID();
@@ -1189,7 +1189,7 @@ class testcaseModel extends model
$stepData->parent = ($stepData->type == 'item') ? $parentStepID : 0;
$stepData->case = $caseID;
$stepData->version = 1;
$stepData->desc = $desc;
$stepData->desc = htmlspecialchars($desc);
$stepData->expect = htmlspecialchars($this->post->expect[$key][$id]);
$this->dao->insert(TABLE_CASESTEP)->data($stepData)->autoCheck()->exec();
if($stepData->type == 'group') $parentStepID = $this->dao->lastInsertID();
+2 -2
View File
@@ -66,7 +66,7 @@
<thead>
<tr>
<th class='w-50px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p70 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p60 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='text-left'><?php echo $lang->testcase->stepExpect;?></th>
</tr>
</thead>
@@ -85,7 +85,7 @@
echo "<th class='step-id'>$stepId</th>";
echo "<td class='text-left'><div class='input-group'>";
if($step->type == 'item') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";
echo nl2br(str_replace(' ', '&nbsp;', htmlspecialchars($step->desc))) . "</td>";
echo nl2br(str_replace(' ', '&nbsp;', $step->desc)) . "</td>";
echo "<td class='text-left'>" . nl2br(str_replace(' ', '&nbsp;', $step->expect)) . "</div></td>";
echo "</tr>";
$childId ++;