note 129890 added to function.iconv-mime-decode-headers
| From: | phpmanual@NOSPAM.headbank.co.uk | Date: | Fri, 29 Nov 2024 18:25:22 +0000 |
| Subject: | note 129890 added to function.iconv-mime-decode-headers | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221691@lists.php.net to get a copy of this message | ||
Just in case this catches anyone else: If your headers string has any leading linebreaks, this
function will reject it and return an empty array. If that might apply to your input, sanitise it
with ltrim().
Trailing empty lines are tolerated/ignored.
Other quirks I noticed just now:
1. Leading whitespace (" " or "\t") in the *first* line will be included in the
header's key name in the returned array. ltrim() will prevent that too.
2. Leading whitespace in any subsequent header (before the key) will cause that line to be appended
to the preceding header's value, as though it were a run-on of that header.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 87.75.113.64)
----
Manual Page -- https://php.net/manual/en/function.iconv-mime-decode-headers.php
Edit -- https://main.php.net/note/edit/129890
Del: integrated -- https://main.php.net/note/delete/129890/integrated
Del: useless -- https://main.php.net/note/delete/129890/useless
Del: bad code -- https://main.php.net/note/delete/129890/bad+code
Del: spam -- https://main.php.net/note/delete/129890/spam
Del: non-english -- https://main.php.net/note/delete/129890/non-english
Del: in docs -- https://main.php.net/note/delete/129890/in+docs
Del: other reasons-- https://main.php.net/note/delete/129890
Reject -- https://main.php.net/note/reject/129890
Search -- https://main.php.net/manage/user-notes.php