Index: trunk/extensions/LabeledSectionTransclusion/lst.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | |
35 | 35 | function wfLabeledSectionTransclusion() |
36 | 36 | { |
37 | | - global $wgParser; |
| 37 | + global $wgParser, $wgVersion, $wgHooks; |
38 | 38 | |
39 | 39 | $wgParser->setHook( 'section', 'wfLstNoop' ); |
40 | 40 | $wgParser->setFunctionHook( 'lst', 'wfLstInclude' ); |
— | — | @@ -83,18 +83,13 @@ |
84 | 84 | **/ |
85 | 85 | function wfLst_parse_($parser, $title, $text, $part1, $skiphead=0) |
86 | 86 | { |
87 | | - global $wgVersion; |
88 | | - |
89 | 87 | // if someone tries something like<section begin=blah>lst only</section> |
90 | 88 | // text, may as well do the right thing. |
91 | 89 | $text = str_replace('</section>', '', $text); |
92 | 90 | |
93 | 91 | if (wfLst_open_($parser, $part1)) { |
94 | | - |
95 | | - //Handle recursion here, so we can break cycles. Although we can't do |
96 | | - //feature detection here, r18473 was only a few weeks before the |
97 | | - //release, so this is close enough. |
98 | | - |
| 92 | + //Handle recursion here, so we can break cycles. |
| 93 | + global $wgVersion; |
99 | 94 | if( version_compare( $wgVersion, "1.9" ) < 0 ) { |
100 | 95 | $text = $parser->replaceVariables($text); |
101 | 96 | wfLst_close_($parser, $part1); |
— | — | @@ -138,7 +133,7 @@ |
139 | 134 | { |
140 | 135 | //count skipped headings, so parser (as of r18218) can skip them, to |
141 | 136 | //prevent wrong heading links (see bug 6563). |
142 | | - $pat = '^(={1,6}).+\s*.*?\1\s*$'; |
| 137 | + $pat = '^(={1,6}).+\1\s*$'; |
143 | 138 | return preg_match_all( "/$pat/im", substr($text,0,$limit), $m); |
144 | 139 | } |
145 | 140 | |