Title: suggested fix
Last modified: August 21, 2016

---

# suggested fix

 *  [Aaron Sylvan](https://wordpress.org/support/users/aaronsylvan/)
 * (@aaronsylvan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/suggested-fix/)
 * I believe the problem is that certain hosts don’t include the finfo function 
   by default, even in PHP5.3… I was able to get around this by changing the function
   near line 136 to:
 *     ```
       function _mime_content_type($filename) {
       	if (function_exists("finfo_file")) {
       		$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension
       		$mime = finfo_file($finfo, $absoluteFilePath);
       		finfo_close($finfo);
       		return $mime;
       	} else if (function_exists("mime_content_type")) {
       		return mime_content_type($absoluteFilePath);
       	} else if (!stristr(ini_get("disable_functions"), "shell_exec")) {
       	// http://stackoverflow.com/a/134930/1593459
       	$file = escapeshellarg($absoluteFilePath);
       	$mime = shell_exec("file -bi " . $absoluteFilePath);
       	return $mime;
       } else {
       	return false;
       }
   
       /*
       	// Instantiate finfo
       	$result = new finfo_open();
       	// Get Mime Type with PHP 5.3 compatible method
       	if (is_resource($result) === true) {
       		return $result->file($filename, FILEINFO_MIME_TYPE);
       	}
   
       	return false;
       */
       }
       ```
   
 * [http://wordpress.org/plugins/image-teleporter/](http://wordpress.org/plugins/image-teleporter/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Trisha Cupra](https://wordpress.org/support/users/trishacupra/)
 * (@trishacupra)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/suggested-fix/#post-4560400)
 * Thanks Aaron.

Viewing 1 replies (of 1 total)

The topic ‘suggested fix’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/image-teleporter_6d7d6f.svg)
 * [Image Teleporter](https://wordpress.org/plugins/image-teleporter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/image-teleporter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/image-teleporter/)
 * [Active Topics](https://wordpress.org/support/plugin/image-teleporter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/image-teleporter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/image-teleporter/reviews/)

## Tags

 * [bugfix](https://wordpress.org/support/topic-tag/bugfix/)

 * 1 reply
 * 2 participants
 * Last reply from: [Trisha Cupra](https://wordpress.org/support/users/trishacupra/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/suggested-fix/#post-4560400)
 * Status: not resolved