• Resolved copytrans

    (@copytrans)


    Uncaught Error: Call to a member function log() on null in /plugins/media-cleaner/core.php:192

    $this->core->log( $err );

    should be changed to:

    $this->log( $err );

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hello,

    Indeed, that can happen! It is fixed already in the latest version but it has not been released yet. I will do this soon. Cheers 🙂

    Thread Starter copytrans

    (@copytrans)

    Great you fixed it. Another bug/limitation that came out during testing:

    Images with names including ä,ö,ü are not correctly returned by the DOMDocument and therefore not recognized as being used (then they falsely get trashed).

    The following modifications in core.php fix it:

    // converts all special characters to utf-8
    $html = mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’);

    // Resolve src-set and shortcodes
    $html = do_shortcode( $html );
    $html = wp_make_content_images_responsive( $html );

    // Create the DOM Document
    $dom = new DOMDocument(‘1.0’, ‘utf-8’);
    @$dom->loadHTML( $html , LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

    The idea behind it came from: https://www.php.net/manual/en/class.domdocument.php#118509

    It can be worth checking if the whole code is required or not to fix the issue.

    Plugin Author Jordy Meow

    (@tigroumeow)

    Thanks a lot for this code. I didn’t come across the issue before, as normally, those non-ASCII characters are renamed by WordPress after upload. I will integrate your code and run a few tests to see how it goes 🙂

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

The topic ‘bug in core.php’ is closed to new replies.