Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

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

Closed
fredden opened this issue Dec 5, 2023 · 1 comment
Labels
Bug Something isn't working

Comments

@fredden
Copy link

fredden commented Dec 5, 2023

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)
@fredden fredden added the Bug Something isn't working label Dec 5, 2023
@laminas-bot
Copy link
Contributor

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:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants