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

Revision: 112729
Author:   yaron
Date:     2012-02-29 21:42:23 +0000 (Wed, 29 Feb 2012)
Log Message:
-----------
Fixed display of category name if it was declare in the template with an alias; 
fix for bug 33510

Modified Paths:
--------------
    trunk/extensions/SemanticForms/specials/SF_Templates.php

Modified: trunk/extensions/SemanticForms/specials/SF_Templates.php
===================================================================
--- trunk/extensions/SemanticForms/specials/SF_Templates.php    2012-02-29 
21:28:29 UTC (rev 112728)
+++ trunk/extensions/SemanticForms/specials/SF_Templates.php    2012-02-29 
21:42:23 UTC (rev 112729)
@@ -102,7 +102,12 @@
                        // category tag, there's a good chance that the last
                        // one will be the relevant one - the others are
                        // probably part of inline queries.
-                       return trim( end( $matches[2] ) );
+                       $categoryName = trim( end( $matches[2] ) );
+                       // If there's a pipe, remove it and anything after it.
+                       $locationOfPipe = strpos( $categoryName, '|' );
+                       if ( $locationOfPipe !== false ) {
+                               $categoryName = substr( $categoryName, 0, 
$locationOfPipe );
+                       }
                }
                return "";
        }


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to