diff --git a/module/bug/model.php b/module/bug/model.php index 22e158d5a1..f99a72c65c 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -133,6 +133,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('openedBy', $this->app->user->account) @@ -144,6 +149,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', ',') diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 7b80736218..55e8bd1f0e 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -52,7 +52,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
bug->legendSteps;?>
-
+
steps), "rows='12' class='form-control kindeditor' hidefocus='true'");?>