http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88332

Revision: 88332
Author:   mkroetzsch
Date:     2011-05-17 17:58:47 +0000 (Tue, 17 May 2011)
Log Message:
-----------
use UTF non-breaking space instead of HTML entity (which would be escaped later 
on)

Modified Paths:
--------------
    
trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php

Modified: 
trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php
===================================================================
--- 
trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php  
    2011-05-17 17:33:12 UTC (rev 88331)
+++ 
trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php  
    2011-05-17 17:58:47 UTC (rev 88332)
@@ -369,7 +369,8 @@
         * @return string  Transformed text
         */
        private function unbreak( $text ) {
-               $text = preg_replace( '/[\s]/u', ' ', $text, - 1, $count );
-               return $count > 2 ? preg_replace( '/( )/u', ' ', $text, 
max( 0, $count - 2 ) ):$text;
+               $nonBreakingSpace = html_entity_decode( ' ', ENT_NOQUOTES, 
'UTF-8' );
+               $text = preg_replace( '/[\s]/u', $nonBreakingSpace, $text, - 1, 
$count );
+               return $count > 2 ? preg_replace( '/($nonBreakingSpace)/u', ' 
', $text, max( 0, $count - 2 ) ):$text;
        }
 }


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

Reply via email to