php / php/php-src

Double quotes accepted unexpectedly for literal value escape in SQLite

Offen
#13,597 10 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@SakiTakamachi arbeitet bereits daran.

Seit 05.3.2024.

Extension: pdo_sqlite Extension: sqlite3 Feature
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

Description

discovered in https://github.com/doctrine/dbal/pull/6325#issuecomment-1977604443

Currently PHP pdo_sqlite (and sqlite3) extensions accept SQL queries /w format that is natively not supported by SQLite degrading our testing quality as such SQL queries cannot be executed outside PHP.

PHP repro: https://3v4l.org/lfZSq

SQLite/native repro: https://dbfiddle.uk/D0hu63uV (reproducible also on https://sqlite.org/fiddle/)

Current behaviour:

" (double quote) accepted for literal value escape

Expected behaviour:

SQLite does not accept " (double quote) natively for literal value escape, I would expect the same from PHP by default, ie. fail with SQLite parse error if some query like select "-1" is executed.

PHP Version

any

Operating System

any

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.