diff options
Diffstat (limited to 'includes/parser/Parser_LinkHooks.php')
-rw-r--r-- | includes/parser/Parser_LinkHooks.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/includes/parser/Parser_LinkHooks.php b/includes/parser/Parser_LinkHooks.php index 90e44943..6bcc324d 100644 --- a/includes/parser/Parser_LinkHooks.php +++ b/includes/parser/Parser_LinkHooks.php @@ -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) ) @@ -210,7 +226,7 @@ class Parser_LinkHooks extends Parser { # Don't allow internal links to pages containing # PROTO: where PROTO is a valid URL protocol; these # should be external links. - if( preg_match('/^\b(?:' . wfUrlProtocols() . ')/', $titleText) ) { + if( preg_match('/^\b(?i:' . wfUrlProtocols() . ')/', $titleText) ) { wfProfileOut( __METHOD__ ); return $wt; } |