作者 lyh

gx

@@ -226,7 +226,16 @@ class BTemplateLogic extends BaseLogic @@ -226,7 +226,16 @@ 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 - @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); 229 + $input = "<link id='1' asdjaklsd dajdklasdjl dasdjkl> dasdklasdlk fasfjasklfjakl fasfjkl <header sadasdasd dsadsa ad >";
  230 + $pattern = "/<link id='1'[^<]*<header/";
  231 + if (preg_match($pattern, $input, $matches)) {
  232 + $result = $matches[0];
  233 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);
  234 +
  235 + echo $result;
  236 + } else {
  237 + echo "未找到匹配内容";
  238 + }
230 $data = [ 239 $data = [
231 'head_html'=>$param['head_html'], 240 'head_html'=>$param['head_html'],
232 'head_css'=>$param['head_css'], 241 'head_css'=>$param['head_css'],