Last modified: 2010-05-15 15:41:10 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
Use $wgRequest only.