X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParser_LinkHooks.php;h=d1ca8aac72a491331211f48b083900ee0c03610a;hb=04b47c018040aa8cf520cbbaab4071dac54a6b27;hp=e4f5d1262a4295f2a7019b0d3d3f83d2917c728a;hpb=51c25010b52edbb335ef1bd9c0d2803ae6c62477;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Parser_LinkHooks.php b/includes/parser/Parser_LinkHooks.php index e4f5d1262a..d1ca8aac72 100644 --- a/includes/parser/Parser_LinkHooks.php +++ b/includes/parser/Parser_LinkHooks.php @@ -149,8 +149,8 @@ class Parser_LinkHooks extends Parser { $holders = new LinkHolderArray( $this ); if( is_null( $this->mTitle ) ) { - wfProfileOut( __METHOD__ ); wfProfileOut( __METHOD__.'-setup' ); + wfProfileOut( __METHOD__ ); throw new MWException( __METHOD__.": \$this->mTitle is null\n" ); } @@ -224,10 +224,12 @@ class Parser_LinkHooks extends Parser { wfProfileIn( __METHOD__ ); $wt = isset($paramText) ? "[[$titleText|$paramText]]" : "[[$titleText]]"; wfProfileIn( __METHOD__."-misc" ); + # 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(?i:' . wfUrlProtocols() . ')/', $titleText) ) { + wfProfileOut( __METHOD__."-misc" ); wfProfileOut( __METHOD__ ); return $wt; }