Last modified: 2010-05-15 15:41:10 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 T8688, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6688 - WebRequest Object Breaks
WebRequest Object Breaks
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.7.x
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-15 09:20 UTC by Martin Dale Lyness
Modified: 2010-05-15 15:41 UTC (History)
0 users

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


Attachments

Description Martin Dale Lyness 2006-07-15 09:20:49 UTC
The WebRequest object breaks when it is called. I am using it to get two items
from a form, but i get an error like this:

Fatal error: Call to a member function on a non-object in
../includes/WebRequest.php on line 137

I looked at the source code of the WebRequest and I thought I would try making
an object so i wasn't calling it statically like the tutorial on the wiki says.
There was no change

Here is a snippit of my calling code:

$webreq = new WebRequest();
	/**
	 * I'll be a good boy and get the post vars using the wikimedia objects :).
	 * Nevermind, it keeps giving me problems i just get it the normal way :(.
	 */
	if(isset($_POST['emailArray']) && isset($_POST['emailMsg']) &&
isset($_POST['emailSbj']) && $webreq->wasPosted()) {
		$emailArray = $webreq->getArray('emailArray');
		$message = $webreq->getVal('emailMsg');
		$subject = $webreq->getVal('emailSbj');
		/* $emailArray = $_POST['emailArray'];
		$message = $_POST['emailMsg'];
		$subject = $_POST['emailSbj']; */
	} else {
		return "Could not find Post variables!".var_dump($_POST);
	}


Regardless if my code is failing or not, the WebRequest object should not be
producing errors, it should return a failure message or something.

Martin
Comment 1 Brion Vibber 2006-07-16 21:56:51 UTC
Use $wgRequest only.

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


Navigation
Links