https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114491

Revision: 114491
Author:   mkroetzsch
Date:     2012-03-26 17:07:55 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
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
    
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php

Modified: 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php   
2012-03-26 16:17:19 UTC (rev 114490)
+++ trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php   
2012-03-26 17:07:55 UTC (rev 114491)
@@ -37,7 +37,7 @@
        protected function handleParameters( array $params, $outputmode ) {
                parent::handleParameters( $params, $outputmode );
                
-               $this->mSep = $params['sep'];
+               $this->mSep = str_replace( '_', ' ', $params['sep'] ); // allow 
"_" for encoding spaces, as documented
                $this->mTemplate = trim( $params['template'] );
                $this->mNamedArgs = $params['named args'];
                $this->mUserParam = trim( $params['userparam'] );

Modified: 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php
===================================================================
--- 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php  
    2012-03-26 16:17:19 UTC (rev 114490)
+++ 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php  
    2012-03-26 17:07:55 UTC (rev 114491)
@@ -280,7 +280,7 @@
                        }
                }
 
-               return $result;         
+               return $result;
        }
        
        /**
@@ -296,10 +296,10 @@
        protected function handleParameters( array $params, $outputmode ) {
                $this->params = $params;
                $this->m_params = $params; // Compat, change made in 1.6.3/1.7
-               
-               $this->mIntro = $params['intro'];
-               $this->mOutro = $params['outro'];
 
+               $this->mIntro = str_replace( '_', ' ', $params['intro'] );
+               $this->mOutro = str_replace( '_', ' ', $params['outro'] );
+
                $this->mSearchlabel = $params['searchlabel'] === false ? null : 
$params['searchlabel'];
 
                switch ( $params['link'] ) {
@@ -469,7 +469,7 @@
         * formats, like 'list' and 'table', for use in their getParameters()
         * functions
         *
-        * @deperecated since 1.8, removal in 1.10
+        * @deprecated since 1.8, removal in 1.10
         *
         * @since 1.5.0
         *
@@ -483,7 +483,7 @@
         * Return an array describing the parameters of the export formats
         * like 'rss' and 'csv', for use in their getParameters() functions
         *
-        * @deperecated since 1.8, removal in 1.10
+        * @deprecated since 1.8, removal in 1.10
         *
         * @since 1.5.0
         *
@@ -556,7 +556,7 @@
         * A function to describe the allowed parameters of a query using
         * any specific format - most query printers should override this
         * function.
-        * 
+        *
         * @since 1.5
         *
         * @return array of Parameter


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to