/** @var bool Whether this HTTP request is "safe" (even if it is an HTTP post) */
protected $markedAsSafe = false;
+ /**
+ * @codeCoverageIgnore
+ */
public function __construct() {
$this->requestTime = isset( $_SERVER['REQUEST_TIME_FLOAT'] )
? $_SERVER['REQUEST_TIME_FLOAT'] : microtime( true );
* @return array|string Cleaned-up version of the given
* @private
*/
- function normalizeUnicode( $data ) {
+ public function normalizeUnicode( $data ) {
if ( is_array( $data ) ) {
foreach ( $data as $key => $val ) {
$data[$key] = $this->normalizeUnicode( $val );
}
}
+ /**
+ * Fetch a scalar from the input without normalization, or return $default
+ * if it's not set.
+ *
+ * Unlike self::getVal(), this does not perform any normalization on the
+ * input value.
+ *
+ * @since 1.28
+ * @param string $name
+ * @param string|null $default Optional default
+ * @return string
+ */
+ public function getRawVal( $name, $default = null ) {
+ $name = strtr( $name, '.', '_' ); // See comment in self::getGPCVal()
+ if ( isset( $this->data[$name] ) && !is_array( $this->data[$name] ) ) {
+ $val = $this->data[$name];
+ } else {
+ $val = $default;
+ }
+ if ( is_null( $val ) ) {
+ return $val;
+ } else {
+ return (string)$val;
+ }
+ }
+
/**
* Fetch a scalar from the input or return $default if it's not set.
* Returns a string. Arrays are discarded. Useful for
* Get the values passed in the query string.
* No transformation is performed on the values.
*
+ * @codeCoverageIgnore
* @return array
*/
public function getQueryValues() {
* Return the contents of the Query with no decoding. Use when you need to
* know exactly what was sent, e.g. for an OAuth signature over the elements.
*
+ * @codeCoverageIgnore
* @return string
*/
public function getRawQueryString() {
/**
* Return the session for this request
+ *
+ * This might unpersist an existing session if it was invalid.
+ *
* @since 1.27
* @note For performance, keep the session locally if you will be making
* much use of it instead of calling this method repeatedly.