laminas / laminas-mime

Create and parse MIME messages and parts
https://docs.laminas.dev/laminas-mime/
BSD 3-Clause "New" or "Revised" License
29 stars 23 forks source link

\Laminas\Mime\Decode::decodeQuotedPrintable() doesn't seem to do what its name suggests #37

Closed fredden closed 11 months ago

fredden commented 11 months ago

Bug Report

Q A
Version(s) 2.12.0

Summary

I can successfully encode a string using \Laminas\Mime\Mime::encodeQuotedPrintable(), however when I use \Laminas\Mime\Decode::decodeQuotedPrintable(), I don't seem to get the expected result.

Current behavior

Passing =0A into \Laminas\Mime\Decode::decodeQuotedPrintable() does not result in a newline character, but instead gives back the same input string.

How to reproduce

<?php

require_once __DIR__ . '/vendor/autoload.php';

$text = "This string spans\ntwo lines.";
$encoded = \Laminas\Mime\Mime::encodeQuotedPrintable($text);
$decoded = \Laminas\Mime\Decode::decodeQuotedPrintable($encoded);

var_dump($text, $encoded, $decoded, $text === $decoded);
string(28) "This string spans
two lines."
string(30) "This string spans=0Atwo lines."
string(30) "This string spans=0Atwo lines."
bool(false)

Expected behavior

string(28) "This string spans
two lines."
string(30) "This string spans=0Atwo lines."
string(28) "This string spans
two lines."
bool(true)
laminas-bot commented 11 months ago

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee. If you have a security issue, please follow our security reporting guidelines. If you wish to take on the role of maintainer, please nominate yourself

If you are looking for an actively maintained package alternative, we recommend: