標籤:style http color os ar 問題 html line
ECSHOP雜誌管理髮送促銷郵件功能十分強大,但每次編輯內容儲存時,均會將HTML郵件內容的“src=”替換為’src=http://.$_SERVER["HTTP_HOST"]‘,即每次儲存均在“src”引用的內容中增加網站路徑,例如:
第一次儲存:
src=”http://mm.meiwei101.com//test.jpg”
第二次儲存:
src=”http://mm.meiwei101.com/http://mm.meiwei101.com//test.jpg”
這顯然是無法接受的,解決此問題方法比較簡單,在/admin/magazine_list.php中找到
elseif ($_POST[‘step‘] == 2){ $magazine_name = trim($_POST[‘magazine_name‘]); $magazine_content = trim($_POST[‘magazine_content‘]); $magazine_content = str_replace(‘src=\"‘,‘src=\"http://‘.$_SERVER[‘HTTP_HOST‘],$magazine_content); $time = gmtime(); $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‘"); $links[] = array(‘text‘ => $_LANG[‘magazine_list‘], ‘href‘ => ‘magazine_list.php?act=list‘); sys_msg($_LANG[‘edit_ok‘], 0, $links);}
注釋$magazine_content = str_replace(‘src=\”‘,’src=\”http://’.$_SERVER[‘HTTP_HOST‘],$magazine_content);
結果如下:
elseif ($_POST[‘step‘] == 2){ $magazine_name = trim($_POST[‘magazine_name‘]); $magazine_content = trim($_POST[‘magazine_content‘]); //$magazine_content = str_replace(‘src=\"‘,‘src=\"http://‘.$_SERVER[‘HTTP_HOST‘],$magazine_content); //禁止儲存時修改路徑 $time = gmtime(); $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‘"); $links[] = array(‘text‘ => $_LANG[‘magazine_list‘], ‘href‘ => ‘magazine_list.php?act=list‘); sys_msg($_LANG[‘edit_ok‘], 0, $links);}