赣南脐橙

keybr

佰草伐

导航

dede 添加了字段 alt信息无法全部替换解决方案!

            $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];
            @SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');
            $this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['body']);
            $this->Fields['body'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['body']);
            $this->Fields['body'] = str_ireplace("<img " ,"<img title=\"".$this->Fields['title']."\" alt=\"".$this->Fields['title']."\" ",$this->Fields['body']);
            $this->Fields['shipai'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['shipai']);
            $this->Fields['shipai'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['shipai']);
            $this->Fields['shipai'] = str_ireplace("<img " ,"<img title=\"".$this->Fields['title']."\" alt=\"".$this->Fields['title']."\" ",$this->Fields['shipai']);
            $this->Fields['information'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['information']);
            $this->Fields['information'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['information']);
            $this->Fields['information'] = str_ireplace("<img " ,"<img title=\"".$this->Fields['title']."\" alt=\"".$this->Fields['title']."\" ",$this->Fields['information']);
            $this->Fields['strength'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['strength']);
            $this->Fields['strength'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['strength']);
            $this->Fields['strength'] = str_ireplace("<img " ,"<img title=\"".$this->Fields['title']."\" alt=\"".$this->Fields['title']."\" ",$this->Fields['strength']);
            $this->Fields['why'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['why']);
            $this->Fields['why'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['why']);
            $this->Fields['why'] = str_ireplace("<img " ,"<img title=\"".$this->Fields['title']."\" alt=\"".$this->Fields['title']."\" ",$this->Fields['why']);
            $this->Fields['case'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['case']);
            $this->Fields['case'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['case']);
            $this->Fields['case'] = str_ireplace("<img " ,"<img title=\"".$this->Fields['title']."案例\" alt=\"".$this->Fields['title']."案例\" ",$this->Fields['case']);

  网上默认方案都是解决的body字段的问题,添加字段后,添加后的就不生效,

只需要修改Fields['case']中单引号里面的内容即可,替换成你现在新增加的字段名就可以了。

posted on 2020-09-15 16:31  佰草伐  阅读(126)  评论(0)    收藏  举报

keybr

php基础知识

Wood Furniture