php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25558 Dbase Version Check added in 4.3.3 detecting bad version when using memo fields
Submitted: 2003-09-16 10:27 UTC Modified: 2003-10-11 21:38 UTC
Votes:7
Avg. Score:5.0 ± 0.0
Reproduced:7 of 7 (100.0%)
Same Version:6 (85.7%)
Same OS:4 (57.1%)
From: dsherron at nbc dot edu Assigned: vlad (profile)
Status: Closed Package: dBase related
PHP Version: 4.3.3 OS: Win 2003
Private report: No CVE-ID: None
 [2003-09-16 10:27 UTC] dsherron at nbc dot edu
Description:
------------
As seen in Version 4.3.3 Changelog:

Fixed bug 23463 (added Dbase2 version check). (Vlad Krupin) 

We are reading from many dbase files, all version 3, and one of them has a memo field.  Prior to version 4.3.2, all of these tables were readable, but with the addition of the version check on 4.3.3, I now recieve the following error when opening the v3 file with memo fields:

-----------snip-----------
Warning: This file appears to be dbase ver. -117. Only version 3 and above is supported. in D:\inetpub\onlineroot\bin\inc_lib_online.php on line 862

Warning: unable to open database D:\inetpub\FPDBF\evaluate.dbf in D:\inetpub\onlineroot\bin\inc_lib_online.php on line 862
Cannot open Unable to get header 
-----------snip-----------

In versions from 4.1.1 - 4.3.2 these database files worked flawlessly.  The memo fields are not important to me, since I am merely checking other fields in the database, but the ability to open and read the other fields has always been there.  This functionality has now been broken with 4.3.3

I would be glad to send an empty database with these properties to help reproduce the problem.

--Dave

Reproduce code:
---------------
if ( !$fp = dbase_open("D:\\inetpub\\FPDBF\\evaluate.dbf",0) ) { 
	echo "Cannot open database\n";
	exit;
}

Expected result:
----------------
<no warning messages, has a usable file handle ($fp)>

Actual result:
--------------
Warning: This file appears to be dbase ver. -117. Only version 3 and above is supported. in D:\inetpub\onlineroot\testing\bug_rep.php on line 1

Warning: unable to open database D:\inetpub\FPDBF\evaluate.dbf in D:\inetpub\onlineroot\testing\bug_rep.php on line 1
Cannot open Unable to get header 

<please note the db file handle is not usable at this point ($fp)>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-22 10:25 UTC] martijn at hexon dot cx
We're experiencing the same problem on Linux 2.4.21.
Our Dbase files are created with the Halcyon component 
for Delphi (www.grifsolu.com) and don't have any memo 
fields.

The error here is: "Warning: This file appears to be 
dbase ver. -125. Only version 3 and above is 
supported."
So that's -125 instead of -117.

I stripped out the version checking and everything 
works just fine.
 [2003-09-22 13:24 UTC] dsherron at nbc dot edu
I'm sure stripping out the code would work for me as well, but since I'm on Windows I depend on the binaries that are posted.  Right now I have backed up to 4.2.3 so I can still use my tables, but we don't want to be left in the past as far as versions go!!!
 [2003-10-01 08:54 UTC] clynx at succont dot de
Could anyone who has the possibility to compile PHP under Windows create a php_dbase.dll for 4.3.3 without the Version check and upload it to anywhere?

It would be absolutely nice ;o)
 [2003-10-01 10:28 UTC] sniper@php.net
Assigned to Vlad who's responsible for adding this check.

 [2003-10-01 12:39 UTC] vlad@php.net
I'll revert my version check, and try to make a dll for you guys, if you still need it.

Vlad
 [2003-10-02 10:33 UTC] dsherron at nbc dot edu
Yes, we still need it.  Where will I be able to get it?

Will a permanent change be incorporated into future versions, or is this just going to be a temporary workaround for 4.2.3?

-- Dave
 [2003-10-02 10:33 UTC] dsherron at nbc dot edu
Oops, excuse me... I meant 4.3.3!

--Dave
 [2003-10-11 21:11 UTC] vlad@php.net
rolled back the change ("fix" for bug #23463) that broke this. 
 [2003-10-11 21:38 UTC] vlad@php.net
some people have asked, so here is the dll minus the version check:
http://www.krupin.net/misc/php_dbase.dll

I think I compiled it right. If not, email me in private.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 14:01:29 2024 UTC