X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWebRequest.php;h=bf99e95b59c010a875ee11b1fdb2c544a0ff99d8;hb=f62bc7536e8c1766ce5a2a616a8b9dcf6046b000;hp=1cbdbf9bb70b6a65ee69f1077db9b5aae7f53b76;hpb=1897f32e6fd50419384e39d091f1e41629d87226;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 1cbdbf9bb7..bf99e95b59 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -705,21 +705,22 @@ class WebRequest { /** * Take an arbitrary query and rewrite the present URL to include it + * @deprecated Use appendQueryValue/appendQueryArray instead * @param string $query Query string fragment; do not include initial '?' - * * @return string */ public function appendQuery( $query ) { + wfDeprecated( __METHOD__, '1.25' ); return $this->appendQueryArray( wfCgiToArray( $query ) ); } /** * @param string $key * @param string $value - * @param bool $onlyquery + * @param bool $onlyquery [deprecated] * @return string */ - public function appendQueryValue( $key, $value, $onlyquery = false ) { + public function appendQueryValue( $key, $value, $onlyquery = true ) { return $this->appendQueryArray( array( $key => $value ), $onlyquery ); } @@ -727,16 +728,21 @@ class WebRequest { * Appends or replaces value of query variables. * * @param array $array Array of values to replace/add to query - * @param bool $onlyquery Whether to only return the query string and not the complete URL + * @param bool $onlyquery Whether to only return the query string and not the complete URL [deprecated] * @return string */ - public function appendQueryArray( $array, $onlyquery = false ) { + public function appendQueryArray( $array, $onlyquery = true ) { global $wgTitle; $newquery = $this->getQueryValues(); unset( $newquery['title'] ); $newquery = array_merge( $newquery, $array ); $query = wfArrayToCgi( $newquery ); - return $onlyquery ? $query : $wgTitle->getLocalURL( $query ); + if ( !$onlyquery ) { + wfDeprecated( __METHOD__, '1.25' ); + return $wgTitle->getLocalURL( $query ); + } + + return $query; } /**