php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46536 dbase_create creates file with corrupted header
Submitted: 2008-11-10 13:44 UTC Modified: 2008-11-10 14:24 UTC
From: info at skfree dot sk Assigned:
Status: Not a bug Package: dBase related
PHP Version: 5.2.6 OS: Debian/Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 - 26 = ?
Subscribe to this entry?

 
 [2008-11-10 13:44 UTC] info at skfree dot sk
Description:
------------
Create a dbase File with Version 5.2.6 will get currupted dbase header.

Can not be opened from Excel or Borlands Dbase-Engine

similar bug Bug #41394 seems to be not resolved.

Reproduce code:
---------------
// database "definition"
                                        
$def = array(
            array("date",       "D"),
            array("name",        "C",  50),
            array("age",       "N",   3, 0),
            array("email",       "C", 128),
            array("ismember", "L")
        );
                                                                        
                                   
// creation
$db = dbase_create("/tmp/test.dbf", $def);

if(!$db) print "<strong>Error!</strong>";
dbase_close($db);


Expected result:
----------------
Hexdump of Dbase File with PHP 5.2.1:
00000000  03 6b 05 0f 00 00 00 00  c1 00 bf 00 00 00 00 00              
       
                   ^^
                    Day: 15
                ^^
                 Month: 5
             ^^
              Year from 1900: 107 + 1900 = 2007
          ^^
           Dbase-Version: 3 = Dbase Level 5


Actual result:
--------------
Hexdump of Dbase File with PHP 5.2.6:

00000000  03 6C 0B 0A 00 00 00 00  c1 00 bf 00 00 00 00 00

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-10 14:22 UTC] jani@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

see bug #45102
 [2008-11-10 14:24 UTC] jani@php.net
And propably bug #46282 too..might all be related to same basic issue..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC