POST <html> from php curl comes escaped - deal with it receiver-side?
Hi
I'm using the API to build a submit connector for inserting whole <html> content with campaignAdd() to phplist.
It seems to me that the sender's php curl must escape all quotes. So receiver-side the code is not valid as-is.
In the API (include/campaigns.php) i need to do:
stripslashes($_REQUEST['message'])
Is this something to consider for you DEVs, or am I only doing a bad approach?
Thanks Best Manu
Yes, there's an annoying discrepancy that needs a fix, which is quite tricky
phpList handles the content by duplicating the escaping somewhere. I haven't found it yet. The complication will be to make sure that a campaign added by phpList UI and phpList API are entered the same way. This is currently not the case, IIRC.
(I dont know if the Email reply worked correctly, so this could become duplicated)
Hi Michiel Are you sure the core functionality is the issue?
Is is not that the API provides the case that finished Code is inserted (which is usually not the case with the GUI), and this is a very special case where an outside factor delivers a very special flavour of "material" (php curl)?
So I suggest it's more about handling the "special case", for example by giving a switch in the REST to tell the API to clean up?
Best M
Hi Michiel
Are you sure the core functionality is the issue?
Is is not that the API provides the case that finished Code is inserted (which is usually not the case with the GUI), and this is a very special case where an outside factor delivers a very special flavour of "material" (php curl)?
So I suggest it's more about handling the "special case", for example by giving a switch in the REST to tell the API to clean up?
Best M
Am 20.10.2016 um 23:10 schrieb Michiel [email protected]:
Yes, there's an annoying discrepancy that needs a fix, which is quite tricky
phpList handles the content by duplicating the escaping somewhere. I haven't found it yet. The complication will be to make sure that a campaign added by phpList UI and phpList API are entered the same way. This is currently not the case, IIRC.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/phpList/phplist-plugin-restapi/issues/39#issuecomment-255229235, or mute the thread https://github.com/notifications/unsubscribe-auth/ARnpb56Y-bOzw1UXgbkbeVhCq6vxP7OQks5q19izgaJpZM4KJBeF.
No, I'm not sure. It would need digging deeper to find out. Unfortunately I don't currently have the time for that.
admin/inc/magic_quotes.php - looks like this "experiment" is bad
as temporary solution remove slashes in admin/plugins/restapi/includes/campaigns.php:102 $stmt->bindParam('message', stripslashes($_REQUEST['message']), PDO::PARAM_STR);