Dependency Graph
View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002992 | mantisbt | bugtracker | public | 2003-02-23 05:31 | 2003-12-13 04:39 |
| Reporter | vboctor | Assigned To | vboctor | ||
| Priority | normal | Severity | block | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | git trunk | ||||
| Summary | 0002992: Unable to attach files to bugs | ||||
| Description | The handling for file uploads is different between uploading project documents and uploading file attachments. In my case, the current code of uploading bug attachments is now working. It uses gpc_get_file() which doesn't seem to work since it strips the back spashes, and hence, leaving paths as: C:FIRSTSECONDTHIRDFILE.XXX rather than C:\FIRST\SECOND\THIRD\FILE.XXX. Note that the upload path is specified and it is the same path where the project documents are uploaded. | ||||
| Additional Information | The error I get is: | ||||
| Tags | No tags attached. | ||||
|
Actually, I tested again the file upload to project, and I got the following error: APPLICATION ERROR 401: ERROR: Database query failed. 1064 |
|
|
I can't reproduce this at all. It works fine in PHP 4.3.0 and 4.2.2. Uploading from IE6 on windows. Server is in apache on linux. |
|
|
and slashes should only be getting stripped if magic_quotes_gpc is turned on (in which case it needs to be stripped)... do you have magic quotes on or off? Presumably I don't see the problem because I'm on linux so I don't get \ in my paths. Note that I tested both project upload and bug upload. |
|
|
So this seems to be a Windows specific problem. I will do further testing and post the results here. From my php.ini: |
|
|
This is now fixed in CVS. It will be included in 0.18.0a3. The bug only applied to installations on Windows servers, hence I did the fix/testing in such environment, I would appreciate testing on other platforms. |
|
|
I have this problem on 0.18.0a3 - Setting magic_quotes_gpc = Off seems to fix it. edited on: 03-11-03 03:19 |
|
|
Bug is still present in 0.18.0a4!: The problem is that the $_FILES['file']['tmp_name'] value is not affected by magic quotes even if they are set to ON. It is set by Php after the file was transfered and MUST NOT be changed. It seems to be some kind of id for the temp-file because the slightest change makes the is_uploaded_file function fail. I fixed it in my case adding the line: |
|
|
Fixed in CVS. Will be included in 0.18.0a5. Sorry for the delay, I had the fix for sometime but forgot to commit it. The fix is to remove the call for gpc_strip_slahes() from within gpc_get_file(). |
|
|
MantisBT: master 5022052e 2003-02-25 09:02 Details Diff |
Fix 0002992: Unable to attach files to bugs This bug also applied to attaching documents to projects. The bug only occurs on Windows server. The reason is that Windows uses \ where unix uses /. Since \ needs escaping and / don't, the problem only occured under Windows. I did a bit of cleanup as well. However, more work can be done in this area, and more factoring of common code between attaching files to bugs, and documents to projects can happen. M core/file_api.php - (file_list_attachments): Order by date_added, rather than no ordering. - (file_add): - use non-escaped filename in constructing the new filename. - removed some unnecessary escaping, like escaping of temp filename which is never saved to the db. - some of the fields were not escaped before being saved to the db. M bug_file_add.php - Added operational successful message before the proceed link. M proj_doc_add.php - Used gpc_get_file() instead of directly accessing $HTTP_POST_FILES. - If document prefix is empty, do not add the dash following it. - Added support for FTP storage. - Escaping of variables. M proj_doc_edit_page.php - Added the file type icon to the edit form. - Hyperlinked the icon / filename to the file. M proj_doc_page.php - Use normal date format rather than complete date format. - Use manage_project_threshold to give access to editing documents (rather than MANAGER). This can have separate config option in the future. - Minor changes in the layout. git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2022 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |
Affected Issues 0002992 |
|
| mod - proj_doc_add.php | Diff File | ||
| mod - doc/ChangeLog | Diff File | ||
| mod - bug_file_add.php | Diff File | ||
| mod - core/file_api.php | Diff File | ||
| mod - proj_doc_edit_page.php | Diff File | ||
| mod - proj_doc_page.php | Diff File | ||
|
MantisBT: master a740894b 2003-04-05 22:18 Details Diff |
Fix 0002992: Unable to attach files to bugs on Windows servers with magic quotes ON M core/gpc_api.php - (gpc_get_file): The gpc_strip_slashes() is no longer called. git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2142 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |
Affected Issues 0002992 |
|
| mod - doc/ChangeLog | Diff File | ||
| mod - core/gpc_api.php | Diff File | ||
related to
child of
duplicate of