作者 邓超

body bug

@@ -834,13 +834,7 @@ class Home extends Base { @@ -834,13 +834,7 @@ class Home extends Base {
834 $body = db()->first(bodySql::first($id)); 834 $body = db()->first(bodySql::first($id));
835 if($body){ 835 if($body){
836 $data['body'] = json_decode($body['text_html'],true); 836 $data['body'] = json_decode($body['text_html'],true);
837 - if(count($data['body']) == 1){  
838 - if(count($data['body'][0])==1){  
839 - if(isset($data['body'][0]['body'])){  
840 - $data['body'][0]['type'] = 'text/html';  
841 - }  
842 - }  
843 - } 837 +
844 $charset = 'utf-8'; 838 $charset = 'utf-8';
845 $htmlbody = ''; 839 $htmlbody = '';
846 foreach ($data['body'] as $bd){ 840 foreach ($data['body'] as $bd){
@@ -853,6 +847,12 @@ class Home extends Base { @@ -853,6 +847,12 @@ class Home extends Base {
853 } 847 }
854 foreach ($data['body'] as $bdk=>$bd){ 848 foreach ($data['body'] as $bdk=>$bd){
855 849
  850 + if(count($bd)==1){
  851 + if(isset($bd['body'])){
  852 + $data['body'][$bdk]['type'] = 'text/html';
  853 + }
  854 + }
  855 +
856 if(!empty($bd['path'])){ 856 if(!empty($bd['path'])){
857 857
858 $data['body'][$bdk]['name'] = @base64_decode($bd['name']); 858 $data['body'][$bdk]['name'] = @base64_decode($bd['name']);