Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

quoted_printable_encode does not encode trailing space

Aperta Adatta ai principianti
#24,458 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
64/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, php
Ambito
backend

Direzione di ricerca

Inizia individuando l’implementazione di quoted_printable_encode e i relativi test esistenti nell’albero dei sorgenti PHP; l’issue non indica file specifici. Riproduci l’esempio con uno spazio finale, quindi verifica che l’output codificato termini con =20, come richiesto dalla regola citata di RFC 2045.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Status: Needs Triage
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

Lingua principale
C
Stelle
40.4k
Fork
8.2k
Merge medio
3g 3h
PR unite (30g)
173

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di php/php-src

Tutte le issue di php/php-src

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.