http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61866
Revision: 61866 Author: yaron Date: 2010-02-02 19:38:12 +0000 (Tue, 02 Feb 2010) Log Message: ----------- Uwe Baumbach's fix for replacing hard-coded 'Category' string Modified Paths: -------------- trunk/extensions/SemanticForms/specials/SF_Templates.php Modified: trunk/extensions/SemanticForms/specials/SF_Templates.php =================================================================== --- trunk/extensions/SemanticForms/specials/SF_Templates.php 2010-02-02 19:37:24 UTC (rev 61865) +++ trunk/extensions/SemanticForms/specials/SF_Templates.php 2010-02-02 19:38:12 UTC (rev 61866) @@ -68,8 +68,11 @@ } function getCategoryDefinedByTemplate($template_article) { + global $wgContLang; + $template_text = $template_article->getContent(); - if (preg_match_all('/\[\[Category:([\w ]*)/', $template_text, $matches)) { + $cat_ns_name = $wgContLang->getNsText(14); + if (preg_match_all("/\[\[$cat_ns_name:(.*)\]\]/", $template_text, $matches)) { // get the last match - if there's more than one // category tag, there's a good chance that the last // one will be the relevant one - the others are _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs