• Resolved klewis

    (@blackawxs)


    My Visual Studio Code is telling me that there is mis-use of a $this variable, starting at line 352 in file class.db.php, under the installer/dup-installer/classes directory. This is the code:

    public static function setCharset($dbh, $charset = null, $collate = null)
        {
            $charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset;
            $collate = (!isset($collate) ) ? $GLOBALS['DBCOLLATE_DEFAULT'] : $collate;
    
            if (self::hasAbility($dbh, 'collation') && !empty($charset)) {
                if (function_exists('mysqli_set_charset') && self::hasAbility($dbh, 'set_charset')) {
                    return mysqli_set_charset($dbh, $charset);
                } else {
                    $sql = " SET NAMES ".mysqli_real_escape_string($this->dbh, $charset);
                    if (!empty($collate)) $sql .= " COLLATE ".mysqli_real_escape_string($this->dbh, $collate);
                    return mysqli_query($dbh, $sql);
                }
            }
        }

    The specific error message is:

    $this cannot be used in static methods

    I’m using the latest version of Duplicator in WordPress 5.0

    • This topic was modified 6 years, 2 months ago by klewis.
    • This topic was modified 6 years, 2 months ago by klewis.
    • This topic was modified 6 years, 2 months ago by klewis.
Viewing 1 replies (of 1 total)
  • Hey @blackawxs,

    Thanks for the feedback! If you can give the developer version a try it will have the updates for this issue. The very latest version (1.3.2) can be found by following these instructions:

    Download Developer Version
    – Uninstall your current version and install this one.

    This should fix the issue, thanks again for the heads up on that!

    Cheers~

Viewing 1 replies (of 1 total)
  • The topic ‘$this error’ is closed to new replies.