r114491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114490‎ | r114491 | r114492 >
Date:17:07, 26 March 2012
Author:mkroetzsch
Status:deferred
Tags:
Comment:
support "_" to encode " " in intro, outro, sep, as it used to be (trailing " " is stripped in the parser function processing, but is very important for these parameters)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php
@@ -280,7 +280,7 @@
281281 }
282282 }
283283
284 - return $result;
 284+ return $result;
285285 }
286286
287287 /**
@@ -296,10 +296,10 @@
297297 protected function handleParameters( array $params, $outputmode ) {
298298 $this->params = $params;
299299 $this->m_params = $params; // Compat, change made in 1.6.3/1.7
300 -
301 - $this->mIntro = $params['intro'];
302 - $this->mOutro = $params['outro'];
303300
 301+ $this->mIntro = str_replace( '_', ' ', $params['intro'] );
 302+ $this->mOutro = str_replace( '_', ' ', $params['outro'] );
 303+
304304 $this->mSearchlabel = $params['searchlabel'] === false ? null : $params['searchlabel'];
305305
306306 switch ( $params['link'] ) {
@@ -469,7 +469,7 @@
470470 * formats, like 'list' and 'table', for use in their getParameters()
471471 * functions
472472 *
473 - * @deperecated since 1.8, removal in 1.10
 473+ * @deprecated since 1.8, removal in 1.10
474474 *
475475 * @since 1.5.0
476476 *
@@ -483,7 +483,7 @@
484484 * Return an array describing the parameters of the export formats
485485 * like 'rss' and 'csv', for use in their getParameters() functions
486486 *
487 - * @deperecated since 1.8, removal in 1.10
 487+ * @deprecated since 1.8, removal in 1.10
488488 *
489489 * @since 1.5.0
490490 *
@@ -556,7 +556,7 @@
557557 * A function to describe the allowed parameters of a query using
558558 * any specific format - most query printers should override this
559559 * function.
560 - *
 560+ *
561561 * @since 1.5
562562 *
563563 * @return array of Parameter
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php
@@ -37,7 +37,7 @@
3838 protected function handleParameters( array $params, $outputmode ) {
3939 parent::handleParameters( $params, $outputmode );
4040
41 - $this->mSep = $params['sep'];
 41+ $this->mSep = str_replace( '_', ' ', $params['sep'] ); // allow "_" for encoding spaces, as documented
4242 $this->mTemplate = trim( $params['template'] );
4343 $this->mNamedArgs = $params['named args'];
4444 $this->mUserParam = trim( $params['userparam'] );

Status & tagging log