作者 lyh

gx

@@ -227,18 +227,12 @@ class BTemplateLogic extends BaseLogic @@ -227,18 +227,12 @@ class BTemplateLogic extends BaseLogic
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($param['html'], true) . PHP_EOL, FILE_APPEND); 229 @file_put_contents(storage_path('logs/lyh_error.log'), var_export($param['html'], true) . PHP_EOL, FILE_APPEND);
230 - $input = "<link id=\"google-fonts-link\" asdasdahsjkdhasjkdhaksjdhkajsdhajksdhjkasdhajksdhka asdasdasdasd>asdhasjkdhajkdhakjdhakjdhaksjdhaksjdhaskjdhasjkdhasjkdhasjkdhaksd<header dasdasdasdas>";  
231 - $pattern = "/<link id=\"google-fonts-link\"(.*?)<header/s";  
232 - if (preg_match($pattern, $input, $matches)) {  
233 - $result = $matches[0];  
234 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);  
235 - }  
236 $data = [ 230 $data = [
237 'head_html'=>$param['head_html'], 231 'head_html'=>$param['head_html'],
238 'head_css'=>$param['head_css'], 232 'head_css'=>$param['head_css'],
239 'footer_html'=>$param['footer_html'], 233 'footer_html'=>$param['footer_html'],
240 'footer_css'=>$param['footer_css'], 234 'footer_css'=>$param['footer_css'],
241 - 'other'=>str_replace('<header','',characterTruncation($param['html'],'/<link id="google-fonts-link"\b[^>]*>(.*?)<header/')), 235 + 'other'=>str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")),
242 ]; 236 ];
243 if($info === false){ 237 if($info === false){
244 $data['template_id'] = $param['template_id']; 238 $data['template_id'] = $param['template_id'];