Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Kriztioan

    (@kriztioan)

    Hi Jordy,

    YoImages works like a charm, thanks!

    With kind regards,
    KrizTioaN

    @mb124: You can make use of the patch-command like: patch < patch.diff; you should have saved the provided patch to a file called patch.diff, or update the file Curl.php manually using your favorite editor (vim/emacs/nano/etc.); the patch is only small, so that is doable. Manually would involve you finding the sections in the Curl.php file that need to be patched. In the patch, which is in diff-format, removal of lines is indicated with a ‘-‘ and additions with a ‘+’; some surrounding text is provided to position yourself and the @-signs give the exact line-numbers. You can do some web-searching to get some more information about using the patch-command and the diff-format.

    Make sure to make a backup of the file before applying the patch, either using the patch-command or manually!

    Good luck!

    Kriztioan

    (@kriztioan)

    @michael Soriano Thank you for pointing out Backwpup. It seems to work as advertised and definitely has some interesting features. Though, the advantage that WP2DB has over Backwpup is that the former makes incremental backups, i.e., only sends over the files that have been modified since the last backup. This saves both bandwidth and CPU cycles [the compression stage of Backwpup is quite intense].

    Kriztioan

    (@kriztioan)

    I am using the WordPress Backup to Dropbox plugin, version 4.4.1. and have come across the “unexpected parameter ‘overwrite'”-issue as well. The WordPress-blog I am maintaining is running PHP 7 and I can confirm that that is indeed what is causing the issue. However, the problem doesn’t lie with the WP Backup to Dropbox plugin itself, but rather with code it relies on from benthedesigner and how that interacts with Curl. PHP 7 Removed support for disabling the CURLOPT_SAFE_UPLOAD option and CURLFile should be used to upload files instead.

    The solution is to modify the /wp-content/plugins/wordpress-backup-to-dropbox/Dropbox/Dropbox/OAuth/Consumer/Curl.php file and make it PHP 7-aware. Below a patch that should do just that. Needles to say that the patch is provided without any warranty and that making a backup of the file before applying is recommended. Although, I can say that it works for my WordPress-blog.

    --- Curl.php	2015-10-04 12:07:22.000000000 -0700
    +++ Curl-patched.php	2016-02-06 09:40:11.000000000 -0800
    @@ -66,7 +66,7 @@
             $options = $this->defaultOptions;
             $options[CURLOPT_CAINFO] = dirname(__FILE__) . '/ca-bundle.pem';
    
    -        if (version_compare(PHP_VERSION, '5.6') >= 0) {
    +        if (version_compare(PHP_VERSION, '5.6') >= 0 && version_compare(PHP_VERSION, '7.0') < 0) {
                 $options[CURLOPT_SAFE_UPLOAD] = false;
             }
    
    @@ -78,7 +78,22 @@
                 $this->outFile = null;
             } elseif ($method == 'POST') { // POST
                 $options[CURLOPT_POST] = true;
    -            $options[CURLOPT_POSTFIELDS] = $request['postfields'];
    +            $postfields = $request['postfields'];
    +            if (version_compare(PHP_VERSION, '7.0') >= 0) {
    +                if (is_array($postfields) == true) {
    +                    foreach ($postfields as $k => $v) {
    +                        if (strpos($v, '@') === 0) {
    +                            $filename = ltrim($v, '@');
    +                            $semicolon = strpos($filename, ';');
    +                            if ($semicolon !== false) {
    +                                $filename = substr($filename, 0, $semicolon);
    +                            }
    +                            $postfields[$k] = new CURLFile($filename);
    +                        }
    +                     }
    +                 }
    +            }
    +            $options[CURLOPT_POSTFIELDS] = $postfields;
             } elseif ($method == 'PUT' && $this->inFile) { // PUT
                 $options[CURLOPT_PUT] = true;
                 $options[CURLOPT_INFILE] = $this->inFile;

    I did provide the plugin’s author with the patch on February 8…

Viewing 4 replies - 1 through 4 (of 4 total)