正在显示
1 个修改的文件
包含
26 行增加
和
0 行删除
| @@ -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 | + '<' => '<', | ||
| 214 | + '>' => '>', | ||
| 215 | + '&' => '&', | ||
| 216 | + '´' => "'", | ||
| 217 | + '"' => '"', | ||
| 218 | + ' ' => ' ', | ||
| 219 | + ''' => "'" | ||
| 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 | { |
-
请 注册 或 登录 后发表评论