php / php/php-src

Double quotes accepted unexpectedly for literal value escape in SQLite

Đang mở
#13,597 10 bình luận 0 reaction 1 người được giao Xem trên GitHub

@SakiTakamachi đang làm issue này rồi.

Từ ngày 5/3/2024.

Extension: pdo_sqlite Extension: sqlite3 Feature
Ngôn ngữ chính
C
Star
40.4k
Fork
8.1k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.