+ /**
+ * Helper to fix up the get{Local,Full,Link,Canonical}URL args
+ */
+ private static function fixUrlQueryArgs( $query, $query2 ) {
+ if ( is_array( $query ) ) {
+ $query = wfArrayToCGI( $query );
+ }
+ if ( $query2 ) {
+ if ( is_string( $query2 ) ) {
+ // $query2 is a string, we will consider this to be
+ // a deprecated $variant argument and add it to the query
+ $query2 = wfArrayToCGI( array( 'variant' => $query2 ) );
+ } else {
+ $query2 = wfArrayToCGI( $query2 );
+ }
+ // If we have $query content add a & to it first
+ if ( $query ) {
+ $query .= '&';
+ }
+ // Now append the queries together
+ $query .= $query2;
+ }
+ return $query;
+ }
+