(bug 18317) Bolded selections in 1 | 3 | etc days on RecentChanges now use <strong...
[lhc/web/wiklou.git] / includes / WebRequest.php
index 949901f..0928e4d 100644 (file)
@@ -55,7 +55,7 @@ class WebRequest {
 
                // POST overrides GET data
                // We don't use $_REQUEST here to avoid interference from cookies...
-               $this->data = wfArrayMerge( $_GET, $_POST );
+               $this->data = $_POST + $_GET;
        }
 
        /**
@@ -231,6 +231,7 @@ class WebRequest {
                        $data = $this->normalizeUnicode( $data );
                        return $data;
                } else {
+                       taint( $default );
                        return $default;
                }
        }
@@ -251,11 +252,23 @@ class WebRequest {
                        $val = $default;
                }
                if( is_null( $val ) ) {
-                       return null;
+                       return $val;
                } else {
                        return (string)$val;
                }
        }
+       
+       /**
+        * Set an aribtrary value into our get/post data.
+        * @param $key string Key name to use
+        * @param $value mixed Value to set
+        * @return mixed old value if one was present, null otherwise
+        */
+       function setVal( $key, $value ) {
+               $ret = isset( $this->data[$key] ) ? $this->data[$key] : null;
+               $this->data[$key] = $value;
+               return $ret;
+       }
 
        /**
         * Fetch an array from the input or return $default if it's not set.