作者 刘锟

update

@@ -119,6 +119,8 @@ class ProjectImport extends Command @@ -119,6 +119,8 @@ class ProjectImport extends Command
119 } 119 }
120 } 120 }
121 121
  122 + $v[0] = $this->special2str($v[0]);
  123 +
122 $total_count += 1; 124 $total_count += 1;
123 try { 125 try {
124 if ($task->type == ImportTask::TYPE_NEWS) { 126 if ($task->type == ImportTask::TYPE_NEWS) {
@@ -200,6 +202,30 @@ class ProjectImport extends Command @@ -200,6 +202,30 @@ class ProjectImport extends Command
200 return false; 202 return false;
201 } 203 }
202 204
  205 + //特殊字符转换
  206 + protected function special2str($str)
  207 + {
  208 + if (strpos($str, ';') === false) {
  209 + return $str;
  210 + }
  211 +
  212 + $list = [
  213 + '&lt;' => '<',
  214 + '&gt;' => '>',
  215 + '&amp;' => '&',
  216 + '&acute;' => "'",
  217 + '&quot;' => '"',
  218 + '&nbsp;' => ' ',
  219 + '&#x27;' => "'"
  220 + ];
  221 +
  222 + foreach ($list as $k => $v) {
  223 + $str = str_replace($k, $v, $str);
  224 + }
  225 +
  226 + return $str;
  227 + }
  228 +
203 //发送站内通知 229 //发送站内通知
204 protected function send_mail($user_list, $time, $type, $success_count, $repeat_count, $fail_count, $reason, $fail_line = []) 230 protected function send_mail($user_list, $time, $type, $success_count, $repeat_count, $fail_count, $reason, $fail_line = [])
205 { 231 {