ECSHOP杂志管理发送促销邮件功能十分强大,但每次编辑内容保存时,均会将HTML邮件内容的“src=”替换为’src=http://.$_SERVER["HTTP_HOST"]‘,即每次保存均在“src”引用的内容中增加站点路径,例如:
第一次保存:
src=”//www.zuimoban.com/test.jpg”
第二次保存:
src=”http://www.zuimoban.comhttp://www.zuimoban.comhttp://www.zuimoban.com/test.jpg”
这显然是无法接受的,解决此问题方法比较简单,在/admin/magazine_list.php中找到
01
|
elseif ($_POST['step'] == 2)
|
03
|
$magazine_name = trim($_POST['magazine_name']);
|
04
|
$magazine_content = trim($_POST['magazine_content']);
|
05
|
$magazine_content = str_replace('src=\"','src=\"http://'.$_SERVER['HTTP_HOST'],$magazine_content);
|
07
|
$db->query("UPDATE " . $ecs->table('mail_templates') . " SET is_html = 1, template_subject = '$magazine_name', template_content = '$magazine_content', last_modify = '$time' WHERE type = 'magazine' AND template_id = '$id'");
|
08
|
$links[] = array('text' => $_LANG['magazine_list'], 'href' => 'magazine_list.php?act=list');
|
09
|
sys_msg($_LANG['edit_ok'], 0, $links);
|
注释$magazine_content = str_replace(‘src=\”‘,’src=\”http://’.$_SERVER['HTTP_HOST'],$magazine_content);
结果如下:
01
|
elseif ($_POST['step'] == 2)
|
03
|
$magazine_name = trim($_POST['magazine_name']);
|
04
|
$magazine_content = trim($_POST['magazine_content']);
|
05
|
//$magazine_content = str_replace('src=\"','src=\"http://'.$_SERVER['HTTP_HOST'],$magazine_content); //禁止保存时修改路径
|
07
|
$db->query("UPDATE " . $ecs->table('mail_templates') . " SET is_html = 1, template_subject = '$magazine_name', template_content = '$magazine_content', last_modify = '$time' WHERE type = 'magazine' AND template_id = '$id'");
|
08
|
$links[] = array('text' => $_LANG['magazine_list'], 'href' => 'magazine_list.php?act=list');
|
09
|
sys_msg($_LANG['edit_ok'], 0, $links);
|