The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form, handling remove of "magic quotes" slashes, stripping illegal input characters and normalizing Unicode sequences.
Usually this is used via a global singleton, $wgRequest. You should not create a second WebRequest object; make a FauxRequest object if you want to pass arbitrary data to some function in place of the web input.
Located in /includes/WebRequest.php (line 37)
Class | Description |
---|---|
FauxRequest | WebRequest clone which takes values from a provided array. |
Take an arbitrary query and rewrite the present URL to include it
If magic_quotes_gpc option is on, run the global arrays through fix_magic_quotes to strip out the stupid dlashes.
WARNING: This should only be done once! Running a second time could damage the values.
Returns true if there is a session cookie set.
This does not necessarily mean that the user is logged in!
HTML-safe version of appendQuery().
Recursively strips slashes from the given array; used for undoing the evil that is magic_quotes_gpc.
Fetch a boolean value from the input or return $default if not set.
Guaranteed to return true or false, with normal PHP semantics for boolean interpretation of strings.
Return true if the named value is set in the input, whatever that value is (even "0"). Return false if the named value is not set.
Example use is checking for the presence of check boxes in forms.
Return the original filename of the uploaded file, as reported by the submitting user agent. HTML-style character entities are interpreted and normalized to Unicode normalization form C, in part to deal with weird input from Safari with non-ASCII filenames.
Other than this the name is not verified for being a safe filename.
Return the size of the upload, or 0.
Return the path to the temporary file where PHP has stored the upload.
Return the request URI with the canonical service and hostname.
Fetch a value from the given array or return $default if it's not set.
\r is stripped from the text, and with some language modules there is an input transliteration applied.
Fetch a value from the given array or return $default if it's not set.
Fetch an integer value from the input or return $default if not set.
Guaranteed to return an integer; non-numeric input will typically return 0.
Check for limit and offset parameters on the input, and return sensible defaults if not given. The limit must be positive and is capped at 5000.
Offset must be positive but is not capped.
Return the path portion of the request URI.
Fetch a text string from the given array or return $default if it's not set. \r is stripped from the text, and with some language modules there is an input transliteration applied. This should generally be used for form <textarea> and <input> fields.
Fetch a value from the input or return $default if it's not set.
Value may be of a string or array, and is not altered.
Extracts the given named values into an array.
If no arguments are given, returns all input values. No transformation is performed on the values.
Recursively normalizes strings in the given array.
For Latin-1, strips illegal XML characters only. For Unicode, marks illegal chars and normalizes to form C.
Returns true if the present request was reached by a POST operation, false otherwise (GET, HEAD, or command-line).
Note that values retrieved by the object may come from the GET URL etc even on a POST request.
Documentation generated on Sun, 20 Mar 2005 19:37:02 -0800 by phpDocumentor 1.3.0RC3