作者 赵彬吉
@@ -304,11 +304,11 @@ class BTemplateLogic extends BaseLogic @@ -304,11 +304,11 @@ class BTemplateLogic extends BaseLogic
304 * @time :2023/12/13 15:39 304 * @time :2023/12/13 15:39
305 */ 305 */
306 public function handleAllHtml($commonInfo,$html){ 306 public function handleAllHtml($commonInfo,$html){
307 - if(!empty($commonInfo)){ 307 + if(!empty($commonInfo['head_html']) && !empty($commonInfo['footer_html'])){
308 $html = preg_replace('/<header\b[^>]*>(.*?)<\/header>/s', $commonInfo['head_html'], $html); 308 $html = preg_replace('/<header\b[^>]*>(.*?)<\/header>/s', $commonInfo['head_html'], $html);
309 $html = preg_replace('/<footer\b[^>]*>(.*?)<\/footer>/s', $commonInfo['footer_html'], $html); 309 $html = preg_replace('/<footer\b[^>]*>(.*?)<\/footer>/s', $commonInfo['footer_html'], $html);
310 - $html = preg_replace('/<style id="globalsojs-header">(.*?)<\/style>/s', $commonInfo['head_css'], $html);  
311 - $html = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', $commonInfo['footer_css'], $html); 310 + $html = preg_replace('/<style id="globalsojs-header">(.*?)<\/style>/s', $commonInfo['head_style'] ?? '', $html);
  311 + $html = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', $commonInfo['footer_style'] ?? '', $html);
312 } 312 }
313 return $html; 313 return $html;
314 } 314 }