r112729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112728‎ | r112729 | r112730 >
Date:21:42, 29 February 2012
Author:yaron
Status:deferred
Tags:
Comment:
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) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_Templates.php
@@ -102,7 +102,12 @@
103103 // category tag, there's a good chance that the last
104104 // one will be the relevant one - the others are
105105 // probably part of inline queries.
106 - return trim( end( $matches[2] ) );
 106+ $categoryName = trim( end( $matches[2] ) );
 107+ // If there's a pipe, remove it and anything after it.
 108+ $locationOfPipe = strpos( $categoryName, '|' );
 109+ if ( $locationOfPipe !== false ) {
 110+ $categoryName = substr( $categoryName, 0, $locationOfPipe );
 111+ }
107112 }
108113 return "";
109114 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r112730Fix for r112729yaron21:44, 29 February 2012