Index: trunk/extensions/SubpageFun/SubpageFun.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | * Support: http://www.mediawiki.org/wiki/Extension_talk:Subpage_Fun |
10 | 10 | * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SubpageFun |
11 | 11 | * |
12 | | - * @version: 0.5.2 |
| 12 | + * @version: 0.5.3 |
13 | 13 | * @license: ISC license |
14 | 14 | * @author: Daniel Werner < danweetz@web.de > |
15 | 15 | * |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | |
51 | 51 | class ExtSubpageFun { |
52 | 52 | |
53 | | - const VERSION = '0.5.2'; |
| 53 | + const VERSION = '0.5.3'; |
54 | 54 | |
55 | 55 | const MAG_SUBPAGETITLE = 'subpagetitle'; |
56 | 56 | const MAG_SUBPAGES = 'subpages'; |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | |
94 | 94 | /** |
95 | 95 | * Helper function for seperating n arguments of a MW parser function |
96 | | - * @return Array |
| 96 | + * @return array |
97 | 97 | */ |
98 | 98 | private static function getFunctionArgsArray( $args ) |
99 | 99 | { |
— | — | @@ -149,21 +149,20 @@ |
150 | 150 | * Create a list with page titles as final output of a SubpageFun function. |
151 | 151 | * The output ist un-parsed wiki markup, no HTML. |
152 | 152 | * |
153 | | - * @param $pages Array the pages |
154 | | - * @param $link Boolean whether or not to link the pages in the list |
155 | | - * @param $sep String glue between the pages |
| 153 | + * @param array $pages array of Title elements |
| 154 | + * @param bool $link whether or not to link the pages in the list |
| 155 | + * @param string $sep glue between the pages |
156 | 156 | * |
157 | | - * @return String |
| 157 | + * @return string |
158 | 158 | */ |
159 | | - private static function createSiteList( $pages, $link = false, $sep = ', ' ) { |
160 | | - //if( $pages === null ) |
161 | | - // return ''; |
| 159 | + protected static function createSiteList( $pages, $link = false, $sep = ', ' ) { |
162 | 160 | $out = array(); |
163 | | - foreach( $pages as $page ) { |
164 | | - $text = wfEscapeWikiText( $page->getPrefixedText() ); |
| 161 | + foreach( $pages as $page ) { |
| 162 | + $text = $page->getPrefixedText(); |
165 | 163 | if( $link ) { |
166 | 164 | $out[] = "[[:{$text}]]"; |
167 | 165 | } else { |
| 166 | + $text = wfEscapeWikiText( $text ); |
168 | 167 | $out[] = $text; |
169 | 168 | } |
170 | 169 | } |
— | — | @@ -174,11 +173,12 @@ |
175 | 174 | * Filters a list of title elements by a word or a regular expression. |
176 | 175 | * The titles name without prefix is taken for comparision. |
177 | 176 | * |
178 | | - * @param array $list |
| 177 | + * @param array $list |
179 | 178 | * @param string $filter |
| 179 | + * |
180 | 180 | * @return array |
181 | 181 | */ |
182 | | - private static function filterSiteList( array $list, $filter = null ) { |
| 182 | + protected static function filterSiteList( array $list, $filter = null ) { |
183 | 183 | // return all if no filter set: |
184 | 184 | if( $filter === null ) { |
185 | 185 | return $list; |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | * |
213 | 213 | * @return boolean |
214 | 214 | */ |
215 | | - private static function isValidRegEx( $pattern ) { |
| 215 | + public static function isValidRegEx( $pattern ) { |
216 | 216 | // validate first for allowd delimiters '/%|' and flags |
217 | 217 | if( ! preg_match( '/^([\\/\\|%]).*\\1[imsSuUx]*$/', $pattern ) ) { |
218 | 218 | return false; |
— | — | @@ -228,9 +228,10 @@ |
229 | 229 | * a number, including negative value, is given |
230 | 230 | * |
231 | 231 | * @param $depth Mixed |
| 232 | + * |
232 | 233 | * @return Mixed null or integer |
233 | 234 | */ |
234 | | - private static function valDepth( $depth ) { |
| 235 | + protected static function valDepth( $depth ) { |
235 | 236 | if( $depth === null || $depth === false || trim( $depth ) === '' ) { |
236 | 237 | return null; |
237 | 238 | } |
Index: trunk/extensions/SubpageFun/RELEASE-NOTES |
— | — | @@ -1,13 +1,16 @@ |
2 | 2 | 'Supage Fun' Changelog: |
3 | 3 | ======================= |
4 | 4 | |
5 | | -* December 2, 2011 - Version 0.5.2: |
| 5 | +* (trunk) -- Version 0.5.3: |
| 6 | + - With parameter 'linked' set, wfEscapeWikiText() won't be used to escape sitenames within links since this could break a link. |
| 7 | + |
| 8 | +* December 2, 2011 -- Version 0.5.2: |
6 | 9 | - Support for 'Parser Fun' extensions 'THIS' function added. With 'Parser Fun' enabled it now is possible to call |
7 | 10 | '{{THIS:SUBPAGETITLE}}' which will output the subpage title of the template or page where the phrase is defined on, not the |
8 | 11 | page which is actually being rendered by the parser as '{{SUBPAGETITLE}}' would output it. |
9 | 12 | - Parser function functions within 'ExtSubpageFun' class now have a 'pf_' prefix. |
10 | 13 | |
11 | | -* November 8, 2011 - Version 0.5.1: |
| 14 | +* November 8, 2011 -- Version 0.5.1: |
12 | 15 | - All functions/variables returning page names in any way are using 'wfEscapeWikiText()' now like other variables like 'PAGENAME' |
13 | 16 | for example. |
14 | 17 | - 'filter' parameter can be used for 'NUMBEROFSUBPAGES'. |