]> granicus.if.org Git - php/commitdiff
MFH
authorMoriyoshi Koizumi <moriyoshi@php.net>
Fri, 15 Nov 2002 16:36:23 +0000 (16:36 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Fri, 15 Nov 2002 16:36:23 +0000 (16:36 +0000)
NEWS
ext/mime_magic/mime_magic.c

diff --git a/NEWS b/NEWS
index a8e865a7890d86e317ff3ec4b25aafaac0ad9de3..52fd4d023dcbcb8cfa2d6cef5fe5abdd52512922 100644 (file)
--- 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).
index 474182d181b0ef0254a776fb663182fcbad113ad..89138d8764f21af779de470dfe222fa8975721df 100644 (file)
@@ -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;
     }