Subscribe2:メール本文が途中で切れた
-
記事を投稿すると同タイミングで、同内容をメールマガジンとして配信する為に、
Subscribe2(現在インストールしているVerは5.6)を導入しています。既に14~5回の配信実績があり、これまでは特に問題なく配信されていましたが、
前回配信時に、メールの本文が途中で切れてしまうという現象が発生しました。
途中で切れてしまった配信メールの最後に[…]という文字列があるので、
何らかの原因で記事が抜粋として扱われてしまったのではないかと推測しています。subscribe2.phpのコードを追ってみましたところ、
563行目、581行目、3319行目にそれぞれarray_push($words, '[...]');
の記述が見られます。
前後のコードは以下の通りですが、phpについて詳しくない為、
どのような条件で[…]を追加されたのかが判断できません。
読めないなりに、何となく「抜粋がある場合、または本文に<!–more–>がある場合…」→push […]かな?とも思っているのですが。563行目前後
$excerpt = $post->post_excerpt; if ( '' == $excerpt ) { // no excerpt, is there a <!--more--> ? if ( false !== strpos($plaintext, '<!--more-->') ) { list($excerpt, $more) = explode('<!--more-->', $plaintext, 2); // strip leading and trailing whitespace $excerpt = strip_tags($excerpt); $excerpt = trim($excerpt); } else { // no <!--more-->, so grab the first 55 words $excerpt = strip_tags($plaintext); $words = explode(' ', $excerpt, $this->excerpt_length + 1); if (count($words) > $this->excerpt_length) { array_pop($words); array_push($words, '[...]'); $excerpt = implode(' ', $words); } } }
581行目前後
$html_excerpt = $post->post_excerpt; if ( '' == $html_excerpt ) { // no excerpt, is there a <!--more--> ? if ( false !== strpos($content, '<!--more-->') ) { list($html_excerpt, $more) = explode('<!--more-->', $content, 2); // strip leading and trailing whitespace $html_excerpt = balanceTags($html_excerpt); $html_excerpt = trim($html_excerpt); } else { // no <!--more-->, so grab the first 55 words $words = explode(' ', $content, $this->excerpt_length + 1); if (count($words) > $this->excerpt_length) { array_pop($words); array_push($words, '[...]'); $html_excerpt = implode(' ', $words); $html_excerpt = trim(balanceTags($html_excerpt)); } } }
3319目前後
$excerpt = $post->post_excerpt; if ( '' == $excerpt ) { // no excerpt, is there a <!--more--> ? if ( false !== strpos($post->post_content, '<!--more-->') ) { list($excerpt, $more) = explode('<!--more-->', $post->post_content, 2); $excerpt = strip_tags($excerpt); if ( function_exists('strip_shortcodes') ) { $excerpt = strip_shortcodes($excerpt); } } else { $excerpt = strip_tags($post->post_content); if ( function_exists('strip_shortcodes') ) { $excerpt = strip_shortcodes($excerpt); } $words = explode(' ', $excerpt, $this->excerpt_length + 1); if ( count($words) > $this->excerpt_length ) { array_pop($words); array_push($words, '[...]'); $excerpt = implode(' ', $words); } } // strip leading and trailing whitespace $excerpt = trim($excerpt); }
また、今回失敗した配信メールには、%という文字や
機種依存の丸囲みの数字(①、②など/うっかり差換え忘れてしまいました;)を含んだ文を
配信しているのですがそれが関係することはありますでしょうか?
ちょうどその文字が入った前後で切れてしまったので。今後同様のことが発生しないようにしたいので、原稿作成上の注意でも結構ですので
何かお分かりになる方がいらっしゃいましたら、アドバイスのほどよろしくお願い致します。
4件の返信を表示中 - 1 - 4件目 (全4件中)
4件の返信を表示中 - 1 - 4件目 (全4件中)
- トピック「Subscribe2:メール本文が途中で切れた」には新たに返信することはできません。