• Getting this error in debug.log

    [19-Jan-2025 15:49:49 UTC] PHP Warning: file_get_contents(): data:// wrapper is disabled in the server configuration by allow_url_fopen=0 in .../wp-content/plugins/mailpoet/lib/NewsletterTemplates/ThumbnailSaver.php on line 126
    [19-Jan-2025 15:49:49 UTC] PHP Warning: file_get_contents(data:image/jpeg;base64,/9j/4AAQ…

    The file_get_contents() call in lib/NewsletterTemplates/ThumbnailSaver.php fails if server has allow_url_fopen=0 setting in PHP.

    Current code:

    125:  private function saveBase64AsImageFile(string $file, string $data): bool {
    126: return file_put_contents($file, file_get_contents($data)) !== false;
    127: }

    Suggested fix: Check allow_url_fopen before using this wrapper conversion hack. Also check result of file_get_contents() which is missing in current code and which would point out the problem as well.

    Mailpoet 5.6.1, WordPress 6.4.5

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Gui A. a11n

    (@guicmazeredo)

    Hi there @ov3rfly ,

    Thanks for reaching out!

    Are you still experiencing this issue with the latest MailPoet and WordPress versions?

    If so, I’d recommend trying solutions shared on this StackOverflow thread:

    https://stackoverflow.com/questions/36952204/warning-file-get-contents-https-wrapper-is-disabled-in-the-server-configu

    Thread Starter Ov3rfly

    (@ov3rfly)

    Code in lib/NewsletterTemplates/ThumbnailSaver.php is unchanged in latest MailPoet 5.6.2, issue still exists.

    Please forward the issue to a programmer who will understand the described missing error check of file_get_contents() result and its implication.

    Changing PHP server settings to work around a programming error in your plugin is not a solution.

    Plugin Support Gui A. a11n

    (@guicmazeredo)

    Hi @ov3rfly ,

    I have reported this to our developers. They filed a bug report but we can’t provide you with an estimated timeframe to release the fix as there are other piorities at the moment. I appreciate your understanding.

    Thank you for reporting this issue!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.