dedecms文章中的图片自动添加ALT属性
打开Include/ arc.archives.class.php
查找:
@SetSysEnv($this->Fields[‘typeid’],$this->Fields[‘typename’],$this->Fields[‘id’],$this->Fields[‘title’],’archives’);
在上面代码后面添加:
//替换图片Alt为文档标题
$this->Fields[‘body’] = str_ireplace(array(‘alt=””‘,’alt=”’),”,$this->Fields[‘body’]);
$this->Fields[‘body’] = preg_replace(“@ [s]{0,}alt[s]{0,}=[“‘s]{0,}[sS]{0,}[“‘s] @isU”,” “,$this->Fields[‘body’]);
$this->Fields[‘body’] = str_ireplace(“