quoted_printable_encode does not encode trailing space
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
首先在 PHP 原始碼樹中找出 quoted_printable_encode 的實作及其現有測試;issue 沒有指定特定檔案。使用結尾帶有空格的範例重現問題,接著檢查編碼後的輸出是否以 =20 結尾,這是所引用的 RFC 2045 規則所要求的。
由索引模型根據 Issue 內容生成。
描述
Description
The following code:
<?php
var_dump(quoted_printable_encode('hello '));
Resulted in this output:
string(6) "hello "
But I expected this output instead:
string(9) "hello=20"
RFC 2045 says:
(3) (White Space) Octets with values of 9 and 32 MAY be represented as US-ASCII TAB (HT) and SPACE characters, respectively, but MUST NOT be so represented at the end of an encoded line. Any TAB (HT) or SPACE characters on an encoded line MUST thus be followed on that line by a printable character. In particular, an "=" at the end of an encoded line, indicating a soft line break (see rule #5) may follow one or more TAB (HT) or SPACE characters. It follows that an octet with decimal value 9 or 32 appearing at the end of an encoded line must be represented according to Rule #1. This rule is necessary because some MTAs (Message Transport Agents, programs which transport messages from one user to another, or perform a portion of such transfers) are known to pad lines of text with SPACEs, and others are known to remove "white space" characters from the end of a line. Therefore, when decoding a Quoted-Printable body, any trailing white space on a line must be deleted, as it will necessarily have been added by intermediate transport agents.
PHP Version
PHP 8.7.0-dev (cli) (built: Oct 18 2026 16:29:33) (NTS DEBUG)
Copyright © The PHP Group and Contributors
Zend Engine v4.7.0-dev, Copyright © Zend by Perforce
with Zend OPcache v8.7.0-dev, Copyright ©, by Zend by Perforce
Operating System
No response
- 主要語言
- C
- 星號
- 40.4k
- 分支
- 8.2k
- 平均合併
- 2 天 22 小時
- 30 天內合併 PR
- 166
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
php/php-src 的其他 Issue
-
quoted_printable_encode() produces lines longer than 76 characters for bytes 0xF5 to 0xFF可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
standard/syslog: the request shutdown hook calls closelog() even when the request never opened syslog可能已有人在做 @lazerg 於 7 天前認領。 未關閉Bug Extension: standard Status: Verified
難度 2/5 半天 新手友好度 62/100
維護者通常 1 天內回覆
-
Bug Status: Needs Triage
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
Feature Status: Needs Triage
難度 2/5 1-3 小時 新手友好度 73/100
維護者通常 1 天內回覆
-
Sockets from synchronous stream_socket_client() are left in non-blocking mode on Windows可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉Bug Status: Needs Triage
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
相似的 Issue
-
v9.6.0: CMake incorrectly enforces presence of libevdev可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 67/100
維護者通常 1 天內回覆
-
IoTSDK
難度 2/5 1-3 小時 新手友好度 70/100
Azure/azure-iot-sdk-c#2776 ·
維護者通常 2 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
bug Component component: net
難度 2/5 1-3 小時 新手友好度 78/100
RT-Thread/rt-thread#11913 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
contiki-ng/contiki-ng#3289 ·
維護者通常 3 天內回覆