Index: trunk/extensions/ImageMap/ImageMap.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * Set this to true to enable extern links [http://www.example.com] as |
6 | 6 | * link destination |
7 | 7 | */ |
8 | | -$wgImageMapAllowExternLink = false; |
| 8 | +$wgImageMapAllowExternalLinks = false; |
9 | 9 | |
10 | 10 | $wgExtensionFunctions[] = 'wfSetupImageMap'; |
11 | 11 | $wgAutoloadClasses['ImageMap'] = dirname(__FILE__).'/ImageMap_body.php'; |
Index: trunk/extensions/ImageMap/ImageMap_body.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | const NONE = 4; |
34 | 34 | |
35 | 35 | static function render( $input, $params, $parser ) { |
36 | | - global $wgScriptPath, $wgUser, $wgImageMapAllowExternLink, $wgUrlProtocols, $wgNoFollowLinks; |
| 36 | + global $wgScriptPath, $wgUser, $wgImageMapAllowExternalLinks, $wgUrlProtocols, $wgNoFollowLinks; |
37 | 37 | |
38 | 38 | $lines = explode( "\n", $input ); |
39 | 39 | |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | } elseif ( preg_match( '/^ \[\[ ([^\]]*+) \]\] \w* $ /x', $link, $m ) ) { |
127 | 127 | $title = Title::newFromText( $m[1] ); |
128 | 128 | $alt = $title->getFullText(); |
129 | | - } elseif ( $wgImageMapAllowExternLink && ( in_array( substr( $link , 1 , strpos($link, '//' )+1 ) , $wgUrlProtocols ) || in_array( substr( $link , 1 , strpos($link, ':' ) ) , $wgUrlProtocols ) ) ) { |
| 129 | + } elseif ( $wgImageMapAllowExternalLinks && ( in_array( substr( $link , 1 , strpos($link, '//' )+1 ) , $wgUrlProtocols ) || in_array( substr( $link , 1 , strpos($link, ':' ) ) , $wgUrlProtocols ) ) ) { |
130 | 130 | if ( preg_match( '/^ \[ ([^\s]*+) \s ([^\]]*+) \] \w* $ /x', $link, $m ) ) { |
131 | 131 | $title = htmlspecialchars( $m[1] ); |
132 | 132 | $alt = htmlspecialchars( trim( $m[2] ) ); |
— | — | @@ -289,10 +289,11 @@ |
290 | 290 | foreach ( $links as $title ) { |
291 | 291 | $parser->mOutput->addLink( $title ); |
292 | 292 | } |
293 | | - foreach ( $extLinks as $title ) { |
294 | | - $parser->mOutput->addExternalLink( $title ); |
| 293 | + if ( isset( $extLinks ) ) { |
| 294 | + foreach ( $extLinks as $title ) { |
| 295 | + $parser->mOutput->addExternalLink( $title ); |
| 296 | + } |
295 | 297 | } |
296 | | - |
297 | 298 | # Armour output against broken parser |
298 | 299 | $output = str_replace( "\n", '', $output ); |
299 | 300 | return $output; |