Merge "Check validity of fetched titles and show a descriptive messages when an inval...
[lhc/web/wiklou.git] / includes / parser / Parser_LinkHooks.php
index e3fab9d..9555bdb 100644 (file)
@@ -2,7 +2,23 @@
 /**
  * Modified version of the PHP parser with hooks for wiki links; experimental
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @file
+ * @ingroup Parser
  */
 
 /**
@@ -84,7 +100,7 @@ class Parser_LinkHooks extends Parser {
         * @param $flags Integer: a combination of the following flags:
         *     SLH_PATTERN   Use a regex link pattern rather than a namespace
         *
-        * @return The old callback function for this name, if any
+        * @return callback|null The old callback function for this name, if any
         */
        public function setLinkHook( $ns, $callback, $flags = 0 ) {
                if( $flags & SLH_PATTERN && !is_string($ns) )
@@ -254,8 +270,8 @@ class Parser_LinkHooks extends Parser {
                }
                if( $return === true ) {
                        # True (treat as plain link) was returned, call the defaultLinkHook
-                       $args = array( $parser, $holders, $markers, $title, $titleText, &$paramText, &$leadingColon );
-                       $return = call_user_func_array( array( 'CoreLinkFunctions', 'defaultLinkHook' ), $args );
+                       $return = CoreLinkFunctions::defaultLinkHook( $parser, $holders, $markers, $title, 
+                               $titleText, $paramText, $leadingColon );
                }
                if( $return === false ) {
                        # False (no link) was returned, output plain wikitext