Commit 68e6df82 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Warn rather than dying horribly when mime_content_type function is unavailable


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 17b3010e
......@@ -43,6 +43,7 @@ $string['registerglobals'] = 'You have dangerous PHP settings, register_globals
$string['magicquotesgpc'] = 'You have dangerous PHP settings, magic_quotes_gpc is on. Mahara is trying to work around this, but you should really fix it';
$string['magicquotesruntime'] = 'You have dangerous PHP settings, magic_quotes_runtime is on. Mahara is trying to work around this, but you should really fix it';
$string['magicquotessybase'] = 'You have dangerous PHP settings, magic_quotes_sybase is on. Mahara is trying to work around this, but you should really fix it';
$string['mimemagicnotloaded'] = 'Your server does not have the mime_magic extension enabled. Mahara may have trouble detecting file types.';
$string['safemodeon'] = 'Your server appears to be running safe mode. Mahara does not support running in safe mode. You must turn this off in either the php.ini file, or in your apache config for the site.
......
......@@ -76,6 +76,12 @@ function ensure_sanity() {
if (!extension_loaded('dom')) {
throw new ConfigSanityException(get_string('domextensionnotloaded', 'error'));
}
if (!function_exists('mime_content_type')) {
log_environ(get_string('mimemagicnotloaded', 'error'));
function mime_content_type($filename) {
return 'application/octet-stream';
}
}
//Check for freetype in the gd extension
$gd_info = gd_info();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment