|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-16 13:17 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
Description: ------------ Create a dbase File with Version 5.2.2 will get currupted dbase header. Can not be opened from Excel or Borlands Dbase-Engine 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 corrupted Dbase File PHP 5.2.2: 00000000 03 6b 05 da 00 00 00 00 c1 00 bf 00 00 00 00 00 ^^ Day: 218 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ^^ Month: 5 ^^ Year from 1900: 107 + 1900 = 2007 ^^ Dbase-Version: 3 = Dbase Level 5