forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #71514: Bad dba_replace condition because of wrong API usage
We're backporting commit 9e309a2 to PHP-5.6, because it is a bugfix.
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--TEST-- | ||
Bug #71514 (Bad dba_replace condition because of wrong API usage) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('dba')) die('skip dba extension not available'); | ||
if (!in_array('inifile', dba_handlers())) die('skip inifile handler not available'); | ||
?> | ||
--FILE-- | ||
<?php | ||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini'; | ||
|
||
$db = dba_open($filename, 'c', 'inifile'); | ||
|
||
dba_insert('foo', 'value1', $db); | ||
dba_replace('foo', 'value2', $db); | ||
var_dump(dba_fetch('foo', $db)); | ||
|
||
dba_close($db); | ||
?> | ||
==DONE== | ||
--EXPECT-- | ||
string(6) "value2" | ||
==DONE== | ||
--CLEAN-- | ||
<?php | ||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini'; | ||
unlink($filename); | ||
?> |