Title: bug in core.php
Last modified: June 14, 2019

---

# bug in core.php

 *  Resolved [copytrans](https://wordpress.org/support/users/copytrans/)
 * (@copytrans)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/bug-in-core-php/)
 * 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](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/bug-in-core-php/#post-11640079)
 * 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](https://wordpress.org/support/users/copytrans/)
 * (@copytrans)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/bug-in-core-php/#post-11647775)
 * Great you fixed it. Another bug/limitation that came out during testing:
 * ![](.../uploads/sites/2/2013/12/musik-übertragen.png)
 * 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](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](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/bug-in-core-php/#post-11659272)
 * 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.

 * ![](https://ps.w.org/media-cleaner/assets/icon-256x256.png?rev=2791576)
 * [Media Cleaner: Clean your WordPress!](https://wordpress.org/plugins/media-cleaner/)
 * [Support Threads](https://wordpress.org/support/plugin/media-cleaner/)
 * [Active Topics](https://wordpress.org/support/plugin/media-cleaner/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-cleaner/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-cleaner/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/bug-in-core-php/#post-11659272)
 * Status: resolved