Skip to content

Special Chars in database.url are not decoded #195

@amenk

Description

@amenk

Preconditions

GdprDump Version: 5.0.5
PHP Version: 8.4
Database Version: 10.11.15-MariaDB-deb12

Steps to reproduce

  1. Database password is 'test!' which is URL encoded in the database URL (.env.local)
    DATABASE_URL=mysql://user:test%[email protected]:3306/testdb
  2. Config file looks like this:
    database:
     url: '%env(DATABASE_URL)%'
  3. Dump script looks like this:
    export $(grep ^DATABASE_URL .env.local | xargs); \
    gdpr-dump

Expected result

Dump is created

Actual result

An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'user'@'localhost' (using password: YES)

Possible fix

I think we need a url_decode for the parameters when decoding the URL

Workaround

Hard-code the password using password: 'test!' in the gdpr-dump.yaml

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