Jump to content

Topic on Project:Support desk

Unable to upload vbs code - ERROR:"No data received"

6
80.169.134.162 (talkcontribs)

Hi All, I hope you can help me out to resolve this problem.

Issue

  • I'm unable to upload the vbs source code of a script I have done in my own personal mediawiki


Sympthom

  • I'm able to paste the code itself within the textarea but once I click on the "save" button I receive the following from the browser:



System Info

  • Guest OS: Linux CentOS 2.6.32-431.5.1.el6.x86_64
  • MediaWiki: v1.22.3
  • API: apache2handler
  • PHP: v5.3.3
  • DB: MySQL v5.1.73 (InnoDB)


Troubleshooting Steps Tried So Far

  • Added the vbs extension to the $wgFileExtensions variable within the LocalSettings.php file
  • Removed the vbs extension from the file blacklist array within the LocalSettings.php file:
$wgFileBlacklist = array_diff( $wgFileBlacklist, array ('vbs') );
  • Managed to narrow down the issue to the following portion of the vbs source code mentioned above:
Sub showMessage(when)
	Select Case when
		Case "begin"
			Set objShell = CreateObject("Wscript.Shell")
			intReturn = objShell.Popup(initialMessage, timeOut, title, informationFlag)
		Case "end"
			MsgBox finalMessage, informationFlag, title
	End Select
End Sub


Note: As you can see, I was able to upload (copy and paste) above the portion of the code that caused me this issue. So it's evident that a parameter or some configuration settings have to be applied in my own MediaWiki.



Any help is much appreciated!

88.130.102.132 (talkcontribs)

Hi!

Yes, you have to add vbs to $wgFileExtensions as by default you won't be able to upload files with this extension otherwise. The blacklist array $wgFileBlacklist overwrites what you have set in $wgFileExtensions, so it's also correct to remove vbs there. Note however that allowing people to upload text files is a security risk for you and your users. Do so only, if you really trust them.

Another aspect might be $wgMimeTypeBlacklist, which will still disallow certain files because of their mime type.However, I am not sure, if your error ERR_EMPTY_RESPONSE is caused by that; if the mime type check failed, users normally do instead get a message displayed, that mime type xyz would not be allowed...

Buffa (talkcontribs)

Hi, Thanks for your answer.

My mediawiki is set as 'private' so I don't mind allowing people (well actually only me) to upload this kind of files.

I haven't checked the $wgMimeTypeBlacklist but I'm pretty sure it doesn't depend on this as I'm able to upload vbs content. The only problem, for some reason, is the portion of vbs code published in my post above which must certainly contain something not good to be submitted in a form. More specifically I furtherly narrowed it down to this:

<source lang="vb">
      Set objShell = CreateObject("Wscript.Shell")	
</source>

Again as you can see I'm able to post it here with no problem but not in my mediawiki.

Any help???

Thanks...

Ciencia Al Poder (talkcontribs)

Check if your server has mod_security installed. It can cause responses to be aborted based on the contents of the page or what you send in forms.

Buffa (talkcontribs)

Hi,

Unfortunately mod_security is not installed: no presence of the file mod_security.conf.

Any other idea?

Thanks.

Ciencia Al Poder (talkcontribs)

look at apache's error_log to see if there's something logged there for those requests.

Reply to "Unable to upload vbs code - ERROR:"No data received""