Commit Graph

298 Commits

Author SHA1 Message Date
Pierre Joye
ce96fd6b07 - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus 2010-11-18 15:22:22 +00:00
Dmitry Stogov
c5237d82bf Added caches to eliminate repeatable run-time bindings of functions, classes, constants, methods and properties 2010-05-24 14:11:39 +00:00
Pierre Joye
cdadeed834 - Fixed bug #51732, Fileinfo __construct or open does not work with NULL 2010-05-04 08:48:58 +00:00
Pierre Joye
fdf0395e49 - Fixed bug #51732, Fileinfo __construct or open does not work with NULL 2010-05-04 08:48:58 +00:00
Kalle Sommer Nielsen
cb30330800 Merge safe_mode changes into extensions that are in sync in both branches 2010-04-26 23:55:03 +00:00
Kalle Sommer Nielsen
dd8e59da8f Removed safe_mode
* Removed ini options, safe_mode*
 * Removed --enable-safe-mode --with-exec-dir configure options on Unix
 * Updated extensions, SAPI's and core
 * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
2010-04-26 23:53:30 +00:00
Johannes Schlüter
26b08f9857 Remove main/php3_compat.h, for that a few references to function_entry have
to be replaced by `zend_function_entry`.
2010-03-30 23:03:02 +00:00
Mikko Koppanen
0a445f4f08 Update the libmagic.patch to reflect the current situation. Contains a diff against upstream 5.03 2010-01-31 22:54:00 +00:00
Felipe Pena
0d5a318090 - Fixed ZTS build 2009-12-27 18:13:37 +00:00
Mikko Koppanen
1e6695feb7 spprintf the dbname
use VCWD_ACCESS instead of access
2009-12-27 00:43:33 +00:00
Mikko Koppanen
1496161f01 Upgrade bundled libmagic to 5.03 (fixes CDF parsing related issues)
Clean up / remove whitespace differences to make next merge easier
Removed unnecessary files from trunk
2009-12-26 15:00:21 +00:00
Pierre Joye
e0b392f028 - fix #49732, fix crash when timestamp conversion fails 2009-10-01 13:55:16 +00:00
Scott MacVicar
a090cd733a Fix BC break in mime_content_type() 2009-08-11 23:05:13 +00:00
Pierre Joye
68a3c3f952 - add license 2009-06-26 07:24:41 +00:00
Felipe Pena
219c2603bb - MFH: Fixed bug #48578 (Can't build 5.3 on FBSD 4.11) (Rasmus) 2009-06-17 16:20:04 +00:00
Scott MacVicar
2d183dcc1d MFH Update bundled libmagic to 5.03 2009-05-09 20:34:37 +00:00
Scott MacVicar
c48241a569 MFH Update libmagic data file to 5.02 2009-05-04 20:56:13 +00:00
Scott MacVicar
c3b88aec15 MFH Update libmagic to 5.02 2009-05-04 20:54:53 +00:00
Pierre Joye
8e202b40a0 - fix the build for win (vc6 or vc9)
- fix logic in time convertion
- force shared on windows, will fix the dirent issue later (no, it is not enough to simply remove the dep or header include)
- add myself before I forget again
2009-03-16 15:03:06 +00:00
Ilia Alshanetsky
ea27fd2ba3 Fixed compiler warnings 2009-03-16 12:52:39 +00:00
Scott MacVicar
e10b18693c MFH fileinfo tests are missing skipif 2009-03-15 23:17:28 +00:00
Scott MacVicar
7a29c8f386 MFH Update fileinfo to libmagic 5.00 and remove dependency on dirent.h on Windows 2009-03-15 23:04:19 +00:00
Andrei Zmievski
d7b6f0103b memset() requires a pointer. 2009-01-12 19:09:34 +00:00
Scott MacVicar
372256b002 MFH Remove all of the stuff we have in here for pre PHP 5.2 support and memset the fileinfo struct. 2008-12-22 16:45:07 +00:00
Derick Rethans
9d1eca8ee1 *** empty log message *** 2008-12-04 14:55:19 +00:00
Scott MacVicar
ceabdbb483 MFH Add asprintf, use regular system malloc and free and add checks in configure.in for the functions 2008-11-27 19:45:27 +00:00
Scott MacVicar
3a93ef37c4 MFH Warnings from libmagic should be notices rather than sent to stderr, this fixes a test on Windows 2008-11-22 10:29:05 +00:00
Felipe Pena
fc2fb50d09 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-11-17 11:28:01 +00:00
Scott MacVicar
a94ac5d436 MFH: Fix buffer overread in libmagic and sync a skipped change from 4.26 2008-11-06 03:00:04 +00:00
Felipe Pena
7a37fa2d6b - Revert ZEND_BEGIN_ARG_INFO change 2008-11-02 21:19:39 +00:00
Scott MacVicar
3e543f2464 MFH: Sync libmagic with 4.26 and add support for the new v6 magic file format 2008-11-02 16:13:49 +00:00
Felipe Pena
df10005563 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-10-24 14:35:40 +00:00
Scott MacVicar
a8c8963bc0 MFH: Fix a stat on a null when the internal database is used. 2008-10-22 16:34:40 +00:00
Scott MacVicar
a6ec097f68 MFH: When using the internal database and there is an error it could try free some invalid things. This was causing a bus error on ppc. 2008-10-22 14:15:47 +00:00
Scott MacVicar
55a965f793 MFH Fix bug #46331 - The internal magic db is const memory and segfaults when you try to do byte swapping
on big endian machines. This fixes it by copying the memory for those processors, but this isn't ideal as
it wastes memory. Perhaps using a static cache would be better.
2008-10-20 23:36:14 +00:00
Pierre Joye
144527b190 - support for VC6 and some other platforms (before some other cleanup) 2008-10-20 14:45:59 +00:00
Ilia Alshanetsky
5a28412ad2 Removed dead-code 2008-10-15 22:56:57 +00:00
Derick Rethans
bac72c6052 - MFH: Fixed mime-type generation.
#- Charset markers need to be prepended with ; -- the tests were also wrong.
2008-10-08 09:44:24 +00:00
Felipe Pena
516ac7e726 - MFH: Fixed bug #46071 (finfo_open() segfaults with wrong file name on BSD) 2008-09-16 22:25:52 +00:00
Antony Dovgal
02022c766c MFH: fix compile warning 2008-09-16 09:48:17 +00:00
Scott MacVicar
3940782c25 MFH: Fix memory leak in a few cases 2008-09-16 09:46:24 +00:00
Scott MacVicar
b845244370 Missed variable declaration. 2008-09-15 22:16:25 +00:00
Scott MacVicar
db907e5bc3 Fixed bug #46086 (Segfault when accessing fileinfo class property) 2008-09-15 22:13:25 +00:00
Felix De Vliegher
7251de9eb8 MFH: More fileinfo tests. 2008-09-15 08:51:43 +00:00
Antony Dovgal
8209f891a4 MFH 2008-09-13 21:32:21 +00:00
Ilia Alshanetsky
a6860ce964 Removed unused variables 2008-09-06 21:31:01 +00:00
Felipe Pena
11319aa113 - New test 2008-09-02 19:28:21 +00:00
Felipe Pena
5b0e87618b - Silent valgrind 2008-09-02 12:43:24 +00:00
Pierre Joye
ed4db08f69 - fix test (file or path not found) (Thanks Dmitry for the notice) 2008-09-02 10:28:11 +00:00
Pierre Joye
c8a0c3b0f5 - don't close caller streams in libmagic (prevent leak and zombie stream)
- string returned by magic_* are freed on magic_close, duplicate before
  calling magic_close (set return value)
- if stat failed, don't try to call magic_* (when FILEINFO_MODE_FILE)
2008-09-02 10:15:54 +00:00
Felipe Pena
d13b704d25 - Fixed mime_content_type() behavior when a string is given
- Fixed check for "empty file name"
- MFH: New test
2008-09-01 23:44:00 +00:00
Pierre Joye
99041160df - use php's stream in libmagic
- remove duplicate code (like mime_content_type() compatibility function
  now use the same base as finfo_file())
- make it portable (works now on windows too, belongs other OSes)

- ([20:28]  <lsmith> Pierre: ok please commit)
2008-09-01 18:56:06 +00:00
Felipe Pena
9566ebabcb - Fixed tests (Disable COMPRESS support for now) 2008-08-29 15:28:45 +00:00
Antony Dovgal
fa978e8595 MFH: check for \0 to be consistent with other functions 2008-08-29 13:48:38 +00:00
Derick Rethans
057b2401bf - Disable COMPRESS support for now, as it requires forking.
# @DOC [DOC] "DOC"
2008-08-29 13:39:01 +00:00
Derick Rethans
4ca7e129a7 - MFH: Adding back in mime_content_type(). 2008-08-29 13:29:42 +00:00
Derick Rethans
6fbf14c544 - MFH: Some more cleanups, and fixed some warnings. 2008-08-29 12:05:46 +00:00
Antony Dovgal
c7c4d96c73 fix invalid read 2008-08-29 10:53:13 +00:00
Felix De Vliegher
ef8ae4dfc5 Some fileinfo tests 2008-08-29 10:29:55 +00:00
Antony Dovgal
f6e15a25da fix ZTS build 2008-08-29 10:12:29 +00:00
Scott MacVicar
907c24fd81 Test for fileinfo to check mime types. 2008-08-29 09:52:13 +00:00
Scott MacVicar
4690692519 Replace ereg code with pcre, fix duplicate macro names and segfault. Patch by Mikko 2008-08-29 09:49:01 +00:00
Antony Dovgal
3bd40d9000 fix file check and avoid segfault 2008-08-27 07:40:44 +00:00
Felipe Pena
7208556ca4 - MFH: Fixed check for empty file name 2008-08-27 01:04:23 +00:00
Felipe Pena
1ef7dfce3d - MFH: Fixed crash in file_error_core() 2008-08-27 00:17:27 +00:00
Felipe Pena
d8c43bde79 - MFH: Improved fix 2008-08-26 16:22:27 +00:00
Felipe Pena
727990f432 - MFH: Added check for empty file name 2008-08-26 15:06:28 +00:00
Ilia Alshanetsky
b805c7f8b7 Upgraded the lib to use PHP memory allocation routines.
Fixed a crash caused by analysis of DEADJOE files
A little bit of CS inside libmagic
2008-08-26 12:23:29 +00:00
Antony Dovgal
273ebb45c9 MFH 2008-08-10 19:48:54 +00:00
Derick Rethans
3cb1759e08 - MFH: Fixed bug #45636 (fileinfo ext duplicate strndup). 2008-08-06 14:42:38 +00:00
Derick Rethans
8c1e71ff83 - MFH: Fixed bug #45717 (Fileinfo/libmagic build fails, missing err.h and
getopt.h).
2008-08-06 14:30:04 +00:00
Pierre Joye
c71b745655 - update config to match config.m4
(still does not build but will be fixed for alpha2)
2008-07-31 13:13:20 +00:00
Scott MacVicar
97400c6cd3 MFH: get fileinfo building again on Windows 2008-07-31 00:33:02 +00:00
Felipe Pena
8085094da8 MFH:
- Added arginfo
- Fixed:
  . proto: finfo_buffer
  . parameter type in _php_finfo_get_type()
2008-07-25 15:23:10 +00:00
Jani Taskinen
ccc012d3f6 MFH: enable fileinfo by default 2008-07-25 09:16:22 +00:00
SVN Migration
7b0f90e0c8 This commit was manufactured by cvs2svn to create branch 'PHP_5_3'. 2008-07-25 08:18:35 +00:00
SVN Migration
14ce4a1d0a This commit was manufactured by cvs2svn to create branch 'PHP_5_3'. 2008-07-25 02:44:58 +00:00
SVN Migration
16b4d8e0e1 This commit was manufactured by cvs2svn to create branch 'PHP_5_3'. 2008-05-12 21:03:49 +00:00
SVN Migration
0e5d551a56 This commit was manufactured by cvs2svn to create branch 'PHP_5_3'. 2007-09-26 15:44:16 +00:00
SVN Migration
4571221d8e This commit was manufactured by cvs2svn to create branch 'PHP_5_1'. 2005-08-08 23:59:05 +00:00
Ilia Alshanetsky
2e79463120 Release news 2005-06-30 21:13:34 +00:00
Ilia Alshanetsky
21e17d7ec0 Final (i hope) set of magic.h detection fixes. 2005-06-29 15:57:16 +00:00
Ilia Alshanetsky
7022fbae55 More reliable library detection.
# Thanks Jani
2005-06-29 13:53:59 +00:00
Ilia Alshanetsky
6f13b138a7 Added another search patch for magic file (fixes bug #3232). 2005-04-05 15:12:52 +00:00
Ilia Alshanetsky
6af3197b90 Improved search paths. 2005-02-17 22:56:47 +00:00
Antony Dovgal
5e8cd3a2da fix segfault when failed to open magic file 2005-01-31 15:01:47 +00:00
Ilia Alshanetsky
25fd4c3bc2 Fixed ZTS build 2005-01-24 23:53:00 +00:00
Ilia Alshanetsky
3849411fa2 Adjust magic path ordering. 2004-08-20 15:11:49 +00:00
Ilia Alshanetsky
420a8cd50a Added /usr/share/misc/file/magic to the possible magic paths (used by Debian) 2004-08-20 13:48:19 +00:00
Ilia Alshanetsky
b59d5af951 Prepare for 0.2 release. 2004-05-26 20:25:58 +00:00
Ilia Alshanetsky
28eaa612c1 Fixed typo. 2004-05-08 17:37:28 +00:00
Derick Rethans
f7afbb9370 - Fixed type which prevented this extension from being loaded as shared
extension.
2004-05-08 17:34:07 +00:00
Ilia Alshanetsky
d641ba3eae More C++ comments. 2004-04-21 23:16:34 +00:00
Ilia Alshanetsky
1b80b33b87 C++ comments are ungood ;). 2004-04-21 23:06:26 +00:00
Hartmut Holzgraefe
375b5df63d libmagic will only consume up to HOWMANY (hardcoded to 65536) bytes
from a file, so lets save bandwith and memory by limiting us to this
2004-04-21 22:49:35 +00:00
Ilia Alshanetsky
5a38078385 Fixes for PHP 4.3.X. 2004-02-13 01:19:57 +00:00
Ilia Alshanetsky
b93acb023d Added package.xml 2004-02-13 01:14:15 +00:00
Ilia Alshanetsky
eb06e0c425 Initial commit of the fileinfo extension. 2004-02-13 01:06:06 +00:00