作者 lyh

gx

@@ -181,7 +181,10 @@ class TranslateLogic extends BaseLogic @@ -181,7 +181,10 @@ class TranslateLogic extends BaseLogic
181 $textContentArray = array_filter($matches[1], function($item) { 181 $textContentArray = array_filter($matches[1], function($item) {
182 return !empty(trim($item)); 182 return !empty(trim($item));
183 }); 183 });
184 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($textContentArray, true) . PHP_EOL, FILE_APPEND); 184 + // 过滤掉包含逗号加换行的内容
  185 + $textContentArray = array_filter($textContentArray, function($item) {
  186 + return strpos($item, ',') === false && strpos($item, PHP_EOL) === false;
  187 + });
185 $contentData = []; 188 $contentData = [];
186 foreach ($textContentArray as $v){ 189 foreach ($textContentArray as $v){
187 $content = trim($v); 190 $content = trim($v);