Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messageAdd command escapes quotes and doublequotes #11

Open
Ingannatore opened this issue Mar 21, 2015 · 2 comments
Open

messageAdd command escapes quotes and doublequotes #11

Ingannatore opened this issue Mar 21, 2015 · 2 comments

Comments

@Ingannatore
Copy link

I sent a new HTML message to phpList using the messageAdd API command (via cUrl) but I've found out that quotes and double quotes have been escaped.

So I tried a simple cUrl request using as content this string:

This is a "double" and 'single' quotes test

After a succesfull API call, I've checked the db and I've see something like that (table phplist_message, column message):

This is a "double" and 'single' quotes test

That's my sending code:

    $response = json_decode($this->callAPI($this->method, $this->url, array(
        'password' => $this->pass,
        'login' => $this->user,
        'cmd' => 'messageAdd',
        'subject' => $subject,
        'fromfield' => $from,
        'replyto' => '',
        'message' => $content,
        'textmessage' => '',
        'footer' => 'If you want to unsubscribe, please use [UNSUBSCRIBE]',
        'status' => 'draft',
        'sendformat' => 'HTML',
        'template' => '4',
        'embargo' => '',
        'rsstemplate' => null,
        'owner' => '2',
        'htmlformatted' => '1'
    )));

Both machines (the sending one with PHP 5.5.9 and the receiving one with PHP 5.3.29) have magic quotes disabled (I've double checked multiple times); the incoming request to the receiving machine is correct, without any escaping.

Everything is pretty fine if I open the message preview; the problems start when I try to edit that message: the WYSIWYG editor seems to not be able to understand an escaped double quote, thus destroying all the message's HTML.

@Ingannatore
Copy link
Author

PS: We also tried moving the receiving end to a PHP 5.5.9 machine but the quotes are still there.

@lippoliv
Copy link

👍

I have the same Problem in phpList 3.3.3 and rest-api 3

Providing a fix would be nice. I have a HTML footer, starting with

<div class='footer'
     style='text-align:left;'>
    <table cellpadding='0'
           cellspacing='0'

Ends up in DB and Mails as

<div class=\'footer\'
     style=\'text-align:left;\'>
    <table cellpadding=\'0\'
           cellspacing=\'0\'

wich is invalid HTML...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants