https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106368

Revision: 106368
Author:   danwe
Date:     2011-12-15 21:07:46 +0000 (Thu, 15 Dec 2011)
Log Message:
-----------
Version increased to 0.5.3.
With parameter 'linked' set, wfEscapeWikiText() won't be used to escape 
sitenames within links since this could break a link.

Modified Paths:
--------------
    trunk/extensions/SubpageFun/RELEASE-NOTES
    trunk/extensions/SubpageFun/SubpageFun.php

Modified: trunk/extensions/SubpageFun/RELEASE-NOTES
===================================================================
--- trunk/extensions/SubpageFun/RELEASE-NOTES   2011-12-15 20:56:43 UTC (rev 
106367)
+++ trunk/extensions/SubpageFun/RELEASE-NOTES   2011-12-15 21:07:46 UTC (rev 
106368)
@@ -1,13 +1,16 @@
  'Supage Fun' Changelog:
  =======================
 
-* December 2, 2011 - Version 0.5.2:
+* (trunk) -- Version 0.5.3:
+  - With parameter 'linked' set, wfEscapeWikiText() won't be used to escape 
sitenames within links since this could break a link.
+
+* December 2, 2011 -- Version 0.5.2:
   - Support for 'Parser Fun' extensions 'THIS' function added. With 'Parser 
Fun' enabled it now is possible to call
     '{{THIS:SUBPAGETITLE}}' which will output the subpage title of the 
template or page where the phrase is defined on, not the
     page which is actually being rendered by the parser as '{{SUBPAGETITLE}}' 
would output it.
   - Parser function functions within 'ExtSubpageFun' class now have a 'pf_' 
prefix.
 
-* November 8, 2011 - Version 0.5.1:
+* November 8, 2011 -- Version 0.5.1:
   - All functions/variables returning page names in any way are using 
'wfEscapeWikiText()' now like other variables like 'PAGENAME'
     for example.
   - 'filter' parameter can be used for 'NUMBEROFSUBPAGES'.

Modified: trunk/extensions/SubpageFun/SubpageFun.php
===================================================================
--- trunk/extensions/SubpageFun/SubpageFun.php  2011-12-15 20:56:43 UTC (rev 
106367)
+++ trunk/extensions/SubpageFun/SubpageFun.php  2011-12-15 21:07:46 UTC (rev 
106368)
@@ -8,7 +8,7 @@
  * Support:       http://www.mediawiki.org/wiki/Extension_talk:Subpage_Fun
  * Source code:   
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SubpageFun
  * 
- * @version: 0.5.2
+ * @version: 0.5.3
  * @license: ISC license
  * @author:  Daniel Werner < [email protected] >
  *
@@ -49,7 +49,7 @@
 
 class ExtSubpageFun {
 
-       const VERSION = '0.5.2';
+       const VERSION = '0.5.3';
 
        const MAG_SUBPAGETITLE     = 'subpagetitle';
        const MAG_SUBPAGES         = 'subpages';
@@ -92,7 +92,7 @@
        
        /**
         * Helper function for seperating n arguments of a MW parser function
-        * @return Array
+        * @return array
         */
        private static function getFunctionArgsArray( $args )
        {
@@ -149,21 +149,20 @@
         * Create a list with page titles as final output of a SubpageFun 
function.
         * The output ist un-parsed wiki markup, no HTML.
         * 
-        * @param $pages Array the pages
-        * @param $link Boolean whether or not to link the pages in the list
-        * @param $sep String glue between the pages
+        * @param array  $pages array of Title elements
+        * @param bool   $link whether or not to link the pages in the list
+        * @param string $sep  glue between the pages
         * 
-        * @return String
+        * @return string
         */
-       private static function createSiteList( $pages, $link = false, $sep = 
', ' ) {          
-               //if( $pages === null )
-               //      return '';
+       protected static function createSiteList( $pages, $link = false, $sep = 
', ' ) {
                $out = array();
-               foreach( $pages as $page ) {
-                       $text = wfEscapeWikiText( $page->getPrefixedText() );
+               foreach( $pages as $page ) {                    
+                       $text = $page->getPrefixedText();
                        if( $link ) {
                                $out[] = "[[:{$text}]]";
                        } else {
+                               $text = wfEscapeWikiText( $text );
                                $out[] = $text;
                        }
                }
@@ -174,11 +173,12 @@
         * Filters a list of title elements by a word or a regular expression.
         * The titles name without prefix is taken for comparision.
         * 
-        * @param array $list
+        * @param array  $list
         * @param string $filter
+        * 
         * @return array 
         */
-       private static function filterSiteList( array $list, $filter = null ) {
+       protected static function filterSiteList( array $list, $filter = null ) 
{
                // return all if no filter set:
                if( $filter === null ) {
                        return $list;
@@ -211,7 +211,7 @@
         * 
         * @return boolean
         */
-       private static function isValidRegEx( $pattern ) {
+       public static function isValidRegEx( $pattern ) {
                // validate first for allowd delimiters '/%|' and flags
                if( ! preg_match( '/^([\\/\\|%]).*\\1[imsSuUx]*$/', $pattern ) 
) {
                        return false;
@@ -228,9 +228,10 @@
         * a number, including negative value, is given
         * 
         * @param $depth Mixed
+        * 
         * @return Mixed null or integer
         */
-       private static function valDepth( $depth ) {
+       protected static function valDepth( $depth ) {
                if( $depth === null || $depth === false || trim( $depth ) === 
'' ) {
                        return null;
                }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to