X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FWebRequest.php;h=b499d86d392c84ebab73f188ae82cb3ce02a4577;hb=744d21be4b42ce4379189855ab093641cdbd5493;hp=e0b8de7076958182a1f54b2269de7eec0810831c;hpb=5ce06f365fceca6ad2bc9e50455b71bb185a903d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebRequest.php b/includes/WebRequest.php index e0b8de7076..b499d86d39 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -129,7 +129,7 @@ class WebRequest { $a = parse_url( $url ); Wikimedia\restoreWarnings(); if ( $a ) { - $path = isset( $a['path'] ) ? $a['path'] : ''; + $path = $a['path'] ?? ''; global $wgScript; if ( $path == $wgScript && $want !== 'all' ) { @@ -275,8 +275,7 @@ class WebRequest { // This method is called from various error handlers and should be kept simple. if ( !self::$reqId ) { - self::$reqId = isset( $_SERVER['UNIQUE_ID'] ) - ? $_SERVER['UNIQUE_ID'] : wfRandomString( 24 ); + self::$reqId = $_SERVER['UNIQUE_ID'] ?? wfRandomString( 24 ); } return self::$reqId; @@ -458,7 +457,7 @@ class WebRequest { * @return mixed Old value if one was present, null otherwise */ public function setVal( $key, $value ) { - $ret = isset( $this->data[$key] ) ? $this->data[$key] : null; + $ret = $this->data[$key] ?? null; $this->data[$key] = $value; return $ret; } @@ -714,7 +713,7 @@ class WebRequest { * @return string */ public function getMethod() { - return isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + return $_SERVER['REQUEST_METHOD'] ?? 'GET'; } /**