Skip to content

Platform value quoting: each platform states its policy, and the driver rollout #260

Backlog

Description

@tyrsson

PlatformInterface already requires quoteValue(), but AbstractPlatform also declared it, with a fallback that escaped the value without consulting the driver. That fallback is the path taken while a connection is not open, so an untrusted value silently received dialect-agnostic backslash escaping instead of a refusal. Each platform now states its own policy and refuses when its driver cannot answer.

The same change stops Select routing limit and offset through quoteValue(), which produced LIMIT '10'. A limit is a non-negative integer, not a value: SQL Server's OFFSET n ROWS and Oracle's OFFSET/FETCH reject a string, and MySQL, PostgreSQL and SQLite accept one only by coercing an unknown literal. The prepared path already bound these as integers.

Pull requests

Remaining drivers

sqlite and pgsql each lock a phpdb snapshot from before RuntimeException::forVulnerablePlatformQuote() existed, so neither change compiles against what they currently resolve. Bumping them to ^0.6.x-dev exposes pre-existing drift that the required Mago gate rejects: 19 analyzer errors and 1 lint warning in sqlite, 28 analyzer errors in pgsql, none of them in AdapterPlatform. Each needs a bring-onto-core change first, then the quoting change on top.

sqlite also declares a $resource property it never assigns, so its platform has never consulted the driver it was constructed with.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions