Re-enable MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals sniff
[lhc/web/wiklou.git] / includes / WebRequest.php
index 6f0307d..e0b8de7 100644 (file)
@@ -28,6 +28,9 @@ use MediaWiki\Session\Session;
 use MediaWiki\Session\SessionId;
 use MediaWiki\Session\SessionManager;
 
+// The point of this class is to be a wrapper around super globals
+// phpcs:disable MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals
+
 /**
  * The WebRequest class encapsulates getting at data passed in the
  * URL or via a POSTed form stripping illegal input characters and
@@ -141,7 +144,7 @@ class WebRequest {
                                $router->add( "$wgScript/$1" );
 
                                if ( isset( $_SERVER['SCRIPT_NAME'] )
-                                       && preg_match( '/\.php5?/', $_SERVER['SCRIPT_NAME'] )
+                                       && preg_match( '/\.php/', $_SERVER['SCRIPT_NAME'] )
                                ) {
                                        # Check for SCRIPT_NAME, we handle index.php explicitly
                                        # But we do have some other .php files such as img_auth.php
@@ -432,7 +435,7 @@ class WebRequest {
         * selected by a drop-down menu). For freeform input, see getText().
         *
         * @param string $name
-        * @param string $default Optional default (or null)
+        * @param string|null $default Optional default (or null)
         * @return string|null
         */
        public function getVal( $name, $default = null ) {
@@ -654,6 +657,18 @@ class WebRequest {
                return $_GET;
        }
 
+       /**
+        * Get the values passed via POST.
+        * No transformation is performed on the values.
+        *
+        * @since 1.32
+        * @codeCoverageIgnore
+        * @return array
+        */
+       public function getPostValues() {
+               return $_POST;
+       }
+
        /**
         * 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.