Index: trunk/extensions/SemanticForms/specials/SF_Templates.php |
— | — | @@ -72,12 +72,12 @@ |
73 | 73 | |
74 | 74 | $template_text = $template_article->getContent(); |
75 | 75 | $cat_ns_name = $wgContLang->getNsText( 14 ); |
76 | | - if ( preg_match_all( "/\[\[(Category|$cat_ns_name):(.*)\]\]/", $template_text, $matches ) ) { |
| 76 | + if ( preg_match_all( "/\[\[(Category|$cat_ns_name):([^\]]*)\]\]/", $template_text, $matches ) ) { |
77 | 77 | // get the last match - if there's more than one |
78 | 78 | // category tag, there's a good chance that the last |
79 | 79 | // one will be the relevant one - the others are |
80 | 80 | // probably part of inline queries |
81 | | - return trim( end( $matches[1] ) ); |
| 81 | + return trim( end( $matches[2] ) ); |
82 | 82 | } |
83 | 83 | return ""; |
84 | 84 | } |