php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60058 No way to upload long code samples in a bug report
Submitted: 2011-10-13 20:46 UTC Modified: 2015-04-15 12:04 UTC
From: david dot gero at ec dot gc dot ca Assigned: cmb (profile)
Status: Closed Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2011-10-13 20:46 UTC] david dot gero at ec dot gc dot ca
Description:
------------
The Description: section of the bug report screen says "upload patches and/or long code samples below", presumably in the Patch file: section with the "Browse" button.

However, if you try to upload a .php file, it complains that the file is "text/x-php", which for some reason it doesn't consider to be text.

Please fix it to allow "text/x-php" to be uploaded.  The levels of authorization needed to create a publicly accessible URL on a government web site remove the possibility of "provide a URL to the source code that will reproduce the bug".


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-13 20:52 UTC] pajoye@php.net
Yes, we should allow that and disable php execution :)

In the meantime you can attach it as text, script.txt instead of .php.
 [2011-10-28 15:41 UTC] david dot gero at ec dot gc dot ca
You are wrong.  Changing the extension to .txt has no effect.  You get the following:

Error: uploaded patch file must be text file (save as e.g. "patch.txt" or "package.diff") (detected "text/x-php")
Could not attach patch "foo.txt" to Bug #12345

Try it for yourself.

I'm betting you're using the "file" command, which does in fact say "text/x-php", no matter what the extension.

Instead of checking for mime type of "text/plain" or "text/html" or whatever, why not just check if the first five chars are "text/", and that the extension is an allowable one like ".diff" or ".txt" or whatever?
 [2015-03-25 00:03 UTC] cmb@php.net
In my opinion, the only bug is the description of the "Description":

| Put short code samples in the "Test script" section below and
| upload patches and/or long code samples below.

Removing the "and/or long code samples" would make it consistent
with the other descriptions, namely the one for "Patch file":

| A patch file created using git diff (unified diff format)

and "Test script":

| A short test script you wrote that demonstrates the bug. Please
| do not post more than 20 lines of code. If the code is longer
| than 20 lines, provide a URL to the source code that will
| reproduce the bug.

I don't see an issue with an external link.
 [2015-04-15 12:04 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-04-15 12:04 UTC] cmb@php.net
The description has been changed to make it more clear that only
patches in unified diff format are accepted for upload. Long test
scripts are better avoided, anyway, and if there is the need for
them, they can be made available somewhere else (e.g.
https://gist.github.com/) and linked to in the ticket.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC