Zen-Cartの商品名、商品説明、定番ページなどに商標マーク「®」などを利用した場合、そのデータを編集するとデータが崩れる場合があります。
例えば商品説明に「Bluetooth®対応」と入れたはずなのに、そのデータを編集すると「Bluetooth潤・ホ応」となってしまいます。

この原因は、最初に登録されるデータは生のまま扱われるので、®(&は半角文字)として登録されますが、編集する際のデータ取得時(inputのデフォルト値として)に、htmlspecialcharsで特殊文字をHTMLエンティティしてないのが原因です。
対応策は以下の通りです。
なお、商品名、商品説明、定番ページ以外でも下記を応用することで対応することができますので、ご参考にどうぞ。

商品名

admin/includes/functions/general.phpのfunction zen_get_products_name内の

return $product->fields['products_name'];

return htmlspecialchars($product->fields['products_name']);

に変更

商品説明

admin/includes/functions/general.phpのfunction zen_get_products_description内の

return $product->fields['products_description'];

return htmlspecialchars($product->fields['products_description']);

に変更

定番ページ

admin/define_pages_editor.phpの

$file_contents = @implode('', $file_array);

$file_contents = @implode('', $file_array);
      $file_contents = htmlspecialchars($file_contents);

に変更

Related Post

  • No Related Posts

Related Ads