dba_insert() for ini files can result in duplicate keys
Abierto
@Girgias ya está trabajando en esto.
Desde el 21/3/2023.
Bug
Extension: dba
Status: Verified
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.1k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Evaluación
Este issue todavía no se ha evaluado.