* Finish task #8009.

This commit is contained in:
tianshujie98
2020-09-23 11:10:28 +08:00
parent 2d27ab2483
commit b106d3a95e
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -106,6 +106,11 @@ class bugModel extends model
*/
public function create($from = '')
{
/* Delete template HTML tags, line breaks and spaces and tags in the steps. */
$stepTemplate = strip_tags($this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect);
$steps = strip_tags(preg_replace("/\s/", "", $this->post->steps));
$steps = str_replace(" ", "", $steps);
$now = helper::now();
$bug = fixer::input('post')
->setDefault('PRJ', $this->session->PRJ)
@@ -118,6 +123,7 @@ class bugModel extends model
->setIF($this->post->assignedTo != '', 'assignedDate', $now)
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
->setIF(strpos($this->config->bug->create->requiredFields, 'project') !== false, 'project', $this->post->project)
->setIF($steps == $stepTemplate, 'steps', '')
->stripTags($this->config->bug->editor->create['id'], $this->config->allowedTags)
->cleanInt('product,project,module,severity')
->join('openedBuild', ',')