dba_insert() for ini files can result in duplicate keys
オープン
@Girgias がすでに取り組んでいます。
2023年3月21日 から。
Bug
Extension: dba
Status: Verified
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
The following code:
<?php
@unlink("test.ini");
touch("test.ini");
$db = dba_open("test.ini", "wl", "inifile");
var_dump($db);
var_dump(dba_fetch("nonexisting", $db));
var_dump(dba_insert("nonexisting", "newvalue", $db));
var_dump(dba_insert("nonexisting", "newvalue", $db));
dba_close($db);
Resulted in this output:
resource(7) of type (dba)
bool(false)
bool(true)
bool(true)
But I expected this output instead:
resource(7) of type (dba)
bool(false)
bool(true)
bool(false)
And additionally: not an extra same-key entry in my ini file.
Because according to the docs at https://www.php.net/manual/en/function.dba-insert.php:
If this key already exist in the database, this function will fail.
PHP Version
PHP 8.1+
Operating System
Linux 6.2.x
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。