From: awjrichards Date: Fri, 20 Apr 2012 22:17:55 +0000 (-0700) Subject: Ensure MWHttpRequest::method gets set with strtoupper() since code X-Git-Tag: 1.31.0-rc.0~23855^2 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=1122ca5f8750a7e23e3f00ad7c03a19ef25f4c17;p=lhc%2Fweb%2Fwiklou.git Ensure MWHttpRequest::method gets set with strtoupper() since code examining MWHttpRequest::method always expects its value to be fully uppercased. Yes, this should not be a problem if MWHttpRequest is accessed via HTTP class, but that will not always be guaranteed. Resolves bug 36137. Change-Id: Ic20e1b99dcb56b8a11cea50293ba44022e564de9 --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index a1d2e59e59..6adef844a2 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -216,6 +216,11 @@ class MWHttpRequest { foreach ( $members as $o ) { if ( isset( $options[$o] ) ) { + // ensure that MWHttpRequest::method is always + // uppercased. Bug 36137 + if ( $o == 'method' ) { + $options[$o] = strtoupper( $options[$o] ); + } $this->$o = $options[$o]; } }