diff options
author | Camil Staps | 2020-05-07 14:36:09 +0200 |
---|---|---|
committer | Camil Staps | 2020-05-07 14:36:09 +0200 |
commit | 24be39cae3c551358bb8e17cef2425c20a4f2eb7 (patch) | |
tree | fb6e059c76db29cfc53b45956e287f606e0d80cc | |
parent | Fix highlighting of current events on list.php (diff) |
Strip Agade footer from emails
-rw-r--r-- | mail.php | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -160,6 +160,14 @@ function mail_parse_message ($body,$prefill_info=[]) $headers[count ($headers)-1]['val'].=' '.trim ($line); } + $desc_begin=$i; + $desc_len=null; + for (; $i<count ($lines); $i++) + if (substr ($lines[$i],0,32)=='--- You are currently subscribed') + $desc_len=$i-$desc_begin; + $desc_lines=array_slice ($lines,$desc_begin,$desc_len); + $info['description']=trim (implode ("\n",$desc_lines)); + foreach ($headers as $header){ $key=$header['key']; $val=$header['val']; @@ -184,8 +192,6 @@ function mail_parse_message ($body,$prefill_info=[]) $warnings[]='Unknown key '.$key; } - $info['description']=trim (implode ("\n",array_slice ($lines,$i))); - foreach (array_keys ($info) as $key) if (is_null ($info[$key])) $warnings[]='No '.$key.' found'; |