From: Moriyoshi Koizumi Date: Fri, 15 Nov 2002 16:36:23 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.3.0RC2~140 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7ac826f893c76745749ada6ff9147f0bf6ae5e9;p=php MFH --- diff --git a/NEWS b/NEWS index a8e865a789..52fd4d023d 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ PHP 4 NEWS - Moved extensions to PECL (http://pear.php.net/): (James, Derick) . ext/vpopmail . ext/cybermut +- Fixed bug #19566 (get_declared_classes() segfaults). (Moriyoshi, Marcus, Andi) +- Fixed bug #20381 (array_merge_recursive mangles input arrays). (Moriyoshi) - Added -n command switch to cli and cgi version which allows to skip php.ini parsing at startup. (Marcus, Wez) - Fixed bug #19689 (absolute paths like /test/dir/ not working correctly). diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c index 474182d181..89138d8764 100644 --- a/ext/mime_magic/mime_magic.c +++ b/ext/mime_magic/mime_magic.c @@ -304,6 +304,11 @@ PHP_FUNCTION(mime_content_type) return; } + if ((int) conf->magic == -1) { + php_error(E_ERROR, MODNAME " could not be initialized, magic file %s is not avaliable", conf->magicfile); + RETURN_FALSE; + } + if(!conf->magic) { php_error(E_WARNING, MODNAME " not initialized"); RETURN_FALSE; @@ -343,10 +348,9 @@ static int apprentice(void) magic_server_config_rec *conf = &mime_global; fname = conf->magicfile; /* todo cwd? */ - f = fopen(fname, "r"); + f = fopen(fname, "rb"); if (f == NULL) { - php_error(E_WARNING, - MODNAME ": can't read magic file %s", fname); + (int) conf->magic = -1; return -1; }