| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- /**
- * 为批量导入 bugs 构造数据。
- * Build bugs for the batch import.
- *
- * @access protected
- * @return array
- */
- protected function buildBugsForImport()
- {
- /* Get bug ID list. */
- $bugIdList = $this->post->id ? $this->post->id : array();
- if(empty($bugIdList)) return array();
- /* Get bugs. */
- $bugs = form::batchData($this->config->bug->form->import)->get();
- $this->app->loadClass('purifier', true);
- $config = ['Filter.YouTube' => 1];
- $purifier = new purifier($config);
- /* Process bugs. */
- foreach($bugs as $index => $bug)
- {
- if(is_array($bug->os)) $bug->os = implode(',', $bug->os);
- if(is_array($bug->browser)) $bug->browser = implode(',', $bug->browser);
- if(is_array($bug->openedBuild)) $bug->openedBuild = implode(',', $bug->openedBuild);
- $bug->steps = nl2br($purifier->purify($bug->steps));
- }
- return $bugs;
- }
|