phpmyadmin / phpmyadmin/phpmyadmin
Importing a CSV file doesn't have enough checks
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 7.9k
- Forks
- 3.6k
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 36
Description
Describe the bug
When importing a PNG instead of a CSV file, a database and table are created, because there aren't enough checks to see if is a valid CSV file or not.
To Reproduce
Steps to reproduce the behavior:
- Go to https://demo.phpmyadmin.net/master-config/index.php?route=/server/import
- Click on
Browse...and select a PNG file - Select
CSVformat - Click on
Import - See error
Expected behavior
It should check and see if the file imported is CSV file or not, and show a message like it does for XML for example.
The CSV file specified was either malformed or incomplete. Please correct the issue and try again.
Screenshots
Server configuration
- Operating system:
- Web server:
- Database version:
- PHP version:
- phpMyAdmin version:
Client configuration
- Browser:
- Operating system:
Additional context
Add any other context about the bug here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the /server/import entry point described in the reproduction steps and reproduce the PNG-as-CSV import. Trace the CSV import validation and compare its behavior with the XML validation mentioned in the issue. Done means invalid non-CSV input is rejected with a clear malformed-or-incomplete message before creating a database or table.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100