Moved FileBackendStore and helper classes to their own file (no code changes). Update...
[lhc/web/wiklou.git] / includes / WebRequest.php
index 601680d..33376cf 100644 (file)
@@ -97,7 +97,7 @@ class WebRequest {
                                        // Abort to keep from breaking...
                                        return $matches;
                                }
-                               
+
                                $router = new PathRouter;
 
                                // Raw PATH_INFO style
@@ -298,8 +298,8 @@ class WebRequest {
        /**
         * Recursively normalizes UTF-8 strings in the given array.
         *
-        * @param $data string or array
-        * @return cleaned-up version of the given
+        * @param $data string|array
+        * @return array|string cleaned-up version of the given
         * @private
         */
        function normalizeUnicode( $data ) {
@@ -379,6 +379,23 @@ class WebRequest {
                return $ret;
        }
 
+       
+       /**
+        * Unset an arbitrary value from our get/post data.
+        *
+        * @param $key String: key name to use
+        * @return Mixed: old value if one was present, null otherwise
+        */
+       public function unsetVal( $key ) {
+               if ( !isset( $this->data[$key] ) ) {
+                       $ret = null;
+               } else {
+                       $ret = $this->data[$key];
+                       unset( $this->data[$key] );
+               }
+               return $ret;
+       }
+
        /**
         * Fetch an array from the input or return $default if it's not set.
         * If source was scalar, will return an array with a single element.
@@ -543,7 +560,7 @@ class WebRequest {
         * @return Array
         */
         public function getQueryValues() {
-               return $_GET;
+               return $_GET;
         }
 
        /**
@@ -838,7 +855,7 @@ class WebRequest {
         * Get a request header, or false if it isn't set
         * @param $name String: case-insensitive header name
         *
-        * @return string|false
+        * @return string|bool False on failure
         */
        public function getHeader( $name ) {
                $this->initHeaders();
@@ -1336,6 +1353,7 @@ class FauxRequest extends WebRequest {
  * (cookies, session and headers).
  *
  * @ingroup HTTP
+ * @since 1.19
  */
 class DerivativeRequest extends FauxRequest {
        private $base;