If you delete a File: redirect using maintenance/deleteBatch.php, the script deletes not only the redirect (correct behavior), but also the uploaded file it points to (arguably incorrect behavior). This destructive act is IMHO a bug because:
- If you perform the same action in the MediaWiki GUI, using the Delete menu item on a File: redirect, the deletion does not touch the uploaded file in the target article.
- In other namespaces, when you delete a redirect with deleteBatch.php, the deletion does not touch the target of that redirect.
Steps to reproduce:
- Upload an image to File:Example.jpg.
- Move File:Example.jpg to File:Renamed.jpg. The original File:Example.jpg is now a redirect.
- Create a file bug.txt containing this single line:
File:Example.jpg
- Run this command:
php deleteBatch.php bug.txt
- The redirect File:Example.jpg has been deleted (correct), and the article File:Renamed.jpg still exists (correct), but the actual uploaded file has been deleted (bad). The article File:Renamed.jpg displays, "No file by this name exists, but you can upload it."
Version: 1.20.x
Severity: major