作者 lyh

gx

@@ -226,7 +226,12 @@ class BTemplateLogic extends BaseLogic @@ -226,7 +226,12 @@ class BTemplateLogic extends BaseLogic
226 public function saveCommonTemplate($param){ 226 public function saveCommonTemplate($param){
227 $templateCommonModel = new BTemplateCommon(); 227 $templateCommonModel = new BTemplateCommon();
228 $info = $templateCommonModel->read(['template_id'=>$param['template_id'],'project_id'=>$this->user['project_id']]); 228 $info = $templateCommonModel->read(['template_id'=>$param['template_id'],'project_id'=>$this->user['project_id']]);
229 - 229 +// $input = "<link id=\"google-fonts-link\" asdasdahsjkdhasjkdhaksjdhkajsdhajksdhjkasdhajksdhka asdasdasdasd>asdhasjkdhajkdhakjdhakjdhaksjdhaksjdhaskjdhasjkdhasjkdhasjkdhaksd<header dasdasdasdas>";
  230 + $pattern = "/<link id=\"google-fonts-link\"(.*?)<header/";
  231 + if (preg_match($pattern, $param['html'], $matches)) {
  232 + $result = $matches[1];
  233 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);
  234 + }
230 @file_put_contents(storage_path('logs/lyh_error.log'), var_export(characterTruncation($param['html'],'/<link id="google-fonts-link"[^<]*<header/'), true) . PHP_EOL, FILE_APPEND); 235 @file_put_contents(storage_path('logs/lyh_error.log'), var_export(characterTruncation($param['html'],'/<link id="google-fonts-link"[^<]*<header/'), true) . PHP_EOL, FILE_APPEND);
231 $data = [ 236 $data = [
232 'head_html'=>$param['head_html'], 237 'head_html'=>$param['head_html'],