Last modified: 2009-10-14 22:25:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23140, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21140 - Fixed Upload Form for Usin an Antivirus Program on Windows
Fixed Upload Form for Usin an Antivirus Program on Windows
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.16.x
PC All
: Normal enhancement (vote)
: ---
Assigned To: Michael Dale
http://festiva.bntbtc.com
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-14 18:23 UTC by Philip Gustafson
Modified: 2009-10-14 22:25 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Fixed uploadbase.php (34.38 KB, patch)
2009-10-14 18:23 UTC, Philip Gustafson
Details
Improved patch (2.24 KB, patch)
2009-10-14 21:00 UTC, Platonides
Details

Description Philip Gustafson 2009-10-14 18:23:24 UTC
Created attachment 6668 [details]
Fixed uploadbase.php

As you may or may not know, using an antivirus program on windows currently does not work because of the way the php code is implemented, it uses a method of capturing the $errorcode$ in a method incompatible with windows.  Although there was a note that someone had found a 50 line work around to make it work.  I contacted him, copied in his code, and now clamscan is tested and working on windows server 2008 r2.  Is it possible to replace the old uploadbase.php in the svn with this one so that all future users will have this option.
Comment 1 Brion Vibber 2009-10-14 18:26:16 UTC
Michael, want to take a peek at this since you've been poking up the upload code?
Comment 2 Philip Gustafson 2009-10-14 18:29:44 UTC
basically it added the function suggested by the user who is already commented in some stuff there, I contacted him and he sent me his function from the php manual site: http://www.php.net/manual/de/function.shell-exec.php#52826, so I added that all inside the antivirus function
Comment 3 Mike.lifeguard 2009-10-14 18:42:04 UTC
(In reply to comment #0)
> Created an attachment (id=6668) [details]
> Fixed uploadbase.php

Could you provide that as a patch against trunk so they can review it?
Comment 4 Philip Gustafson 2009-10-14 18:45:37 UTC
If I knew how, a quick explanation on how and I could probably do it
Comment 5 Michael Dale 2009-10-14 20:35:11 UTC
(In reply to comment #4)
> If I knew how, a quick explanation on how and I could probably do it
> 

You can Make a diff by checking out the trunk from the svn and then running svn diff and putting the output of that into a file you post here. 
Comment 6 Platonides 2009-10-14 21:00:39 UTC
Created attachment 6671 [details]
Improved patch

Philip's version had several issues: it called the AV twice, discarded the output and defined the helper runExternal function inside detectVirus().
Here's a patch against trunk of the solution, fixing the above issues.
Comment 7 Michael Dale 2009-10-14 21:40:57 UTC
I don't actually have a windows server setup to test but "looks good" added in r57728
Comment 8 Michael Dale 2009-10-14 21:52:45 UTC
followup in r57729 we want to try and use the wfShellExec function. Let us know if that works on windows.
Comment 9 Philip Gustafson 2009-10-14 22:25:42 UTC
after some messing around with svn, patching it twice, and realizing it would add the same code twice if I did that, lol, I finally patched your patch, and it works!!! yay!!  I say submit it to the svn trunk!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links