Project

General

Profile

Actions

Bug #47969

closed

Call to undefined function mime_content_type()

Added by Oliver Hader almost 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2013-05-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:

Description

Call to undefined function mime_content_type() on fetching the mime type of the favicon.
I'm still investigating the PHP versions and environment. However it looks like a superfluous regression from #46126


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #46126: Make mimetype-detection possible without finfo_file (pre-PHP-5.3, no pecl-fileinfo)Closed2013-03-08

Actions
Actions #1

Updated by Borries Jensen almost 11 years ago

After an update from 4.5.25 to 4.5.26 the same problem exists.

PHP version used on one dev/test server is 5.2.5.

Actions #2

Updated by Oliver Hader almost 11 years ago

  • Priority changed from Should have to Must have
Actions #3

Updated by Oliver Hader almost 11 years ago

Borries Jensen wrote:

After an update from 4.5.25 to 4.5.26 the same problem.

PHP Version used on one Dev/Test-Server is 5.2.5

Thanks for your response. What distribution/operating system and which version are you using?
Is it a custom compiled PHP version or a standard package of PHP that is being used?

Actions #4

Updated by Borries Jensen almost 11 years ago

Ok, detailed info of the dev machine follows:

SUSE Linux Enterprise Server 10 (i586)
VERSION = 10
PATCHLEVEL = 2

PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli)
This PHP version is/was the one from SLES repository (no custom compilation done by us).

Actions #5

Updated by Oliver Hader almost 11 years ago

  • Status changed from New to Accepted
Actions #6

Updated by Markus Klein almost 11 years ago

What's going on here??
mime_content_type is available since PHP 4.3, so the method should be present in 5.2.5.

Actions #7

Updated by Borries Jensen almost 11 years ago

Hm, am i right that to use the function mime_content_type() the server needs not only the apache module "mod_mime" but also "mod_mime_magic" ?

I just checked the server which causes the mentioned error.
Only "mod_mime" is active there.
Maybe that's causing the error.

Actions #8

Updated by Thorsten Kahler almost 11 years ago

According to http://php.net/manual/en/fileinfo.installation.php the Fileinfo extension requires a (patched) magic_open library (libmagic) in PHP versions < 5.3.0. It is provided and enabled by default, but still not part of the PHP core.
As of PHP 5.3.0 (?) mime_content_type() is deprecated and replaced by the finfo class.

All in all: these functions/classes seem to be moving ground and might require a more sophisticated approach. I think a wrapper method to abstract from the different implementations should help.

Actions #9

Updated by Markus Klein almost 11 years ago

There's another requirement that might play a role: required library "magic_open"
http://at1.php.net/manual/en/fileinfo.requirements.php

Actions #10

Updated by Borries Jensen almost 11 years ago

Only enabling "mod_mime_magic" did not solve the problem.
Just tried it on the mentioned machine.

Actions #11

Updated by Oliver Hader almost 11 years ago

It's a regression thus needs to be fixed. Not having a mime-type for the favicon does not harm (as it has been before), but running into a fatal error on each frontend request does. No need to discuss that further - it's a bug.

Actions #12

Updated by Markus Klein almost 11 years ago

I guess a simple function_exists() call to check the existence is fine?

Actions #13

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/20557

Actions #14

Updated by Christian Kuhn almost 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #15

Updated by Tomas Norre Mikkelsen almost 11 years ago

Hi,

Will these result in a new TYPO3 release? Or just included in next release? I have a lot of solutions not updated cause of the issue.

Actions #16

Updated by Markus Klein almost 11 years ago

@Tomas: It will definitely be included in the next bugfix release. In the meanwhile you can apply the patch manually to your installations.

Actions #17

Updated by Tomas Norre Mikkelsen almost 11 years ago

@Markus: Do you know when next release will be? Have about 15 servers which need to be patched. And normally I/we don't allow "manipulated" sources.

Actions #18

Updated by Ernesto Baschny over 10 years ago

  • Is Regression set to Yes
Actions #19

Updated by Ernesto Baschny over 10 years ago

  • Category changed from 1394 to Frontend
Actions #20

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF