r80629 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80628‎ | r80629 | r80630 >
Date:16:16, 20 January 2011
Author:yaron
Status:deferred
Tags:
Comment:
More fixes for Special:RunQuery handling
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php
@@ -220,9 +220,23 @@
221221 $page_title = $wgTitle;
222222 global $wgUser;
223223 $skin = $wgUser->getSkin();
224 - foreach ( $wgRequest->getValues() as $key => $value ) {
 224+ $request_values = $wgRequest->getValues();
 225+ // Also go through the predefined PHP variable
 226+ // $_REQUEST, because $wgRequest->getValues() for
 227+ // some reason doesn't return array values - is
 228+ // there a better (less hacky) way to do this?
 229+ foreach ( $_REQUEST as $key => $value ) {
 230+ if ( is_array( $value ) ) {
 231+ foreach ($value as $k2 => $v2 ) {
 232+ $new_key = $key . '[' . $k2 . ']';
 233+ $request_values[$new_key] = $v2;
 234+ }
 235+ }
 236+ }
 237+ foreach ( $request_values as $key => $value ) {
225238 if ( $key != 'month' && $key != 'year'
226 - && $key != 'query' // from 'RunQuery'
 239+ // values from 'RunQuery'
 240+ && $key != 'query' && $key != 'free_text'
227241 ) {
228242 $additional_query_string .= "&$key=$value";
229243 $hidden_inputs .= "<input type=\"hidden\" name=\"$key\" value=\"$value\" />";
@@ -272,7 +286,7 @@
273287 if ( $prev_year == "0" ) { $prev_year = "-1"; }
274288 $prev_month_url = $page_title->getLocalURL( "month=$prev_month_num&year=$prev_year" . $additional_query_string );
275289 $next_month_url = $page_title->getLocalURL( "month=$next_month_num&year=$next_year" . $additional_query_string );
276 - $today_url = $page_title->getLocalURL();
 290+ $today_url = $page_title->getLocalURL( $additional_query_string );
277291 $today_text = wfMsg( 'srfc_today' );
278292 $prev_month_text = wfMsg( 'srfc_previousmonth' );
279293 $next_month_text = wfMsg( 'srfc_nextmonth' );

Status & tagging log