禁止ecshop雜誌編輯器自動修改路徑

來源:互聯網
上載者:User

標籤: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);}


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.