r23292 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23291‎ | r23292 | r23293 >
Date:11:01, 23 June 2007
Author:tstarling
Status:old
Tags:
Comment:
Removed $wgImageMapAllowExternalLinks, feature enabled unconditionally. Not sure why you wouldn't want that.
Modified paths:
  • /trunk/extensions/ImageMap/ImageMap.php (modified) (history)
  • /trunk/extensions/ImageMap/ImageMap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImageMap/ImageMap_body.php
@@ -32,7 +32,7 @@
3333 const NONE = 4;
3434
3535 static function render( $input, $params, $parser ) {
36 - global $wgScriptPath, $wgUser, $wgImageMapAllowExternalLinks, $wgUrlProtocols, $wgNoFollowLinks;
 36+ global $wgScriptPath, $wgUser, $wgUrlProtocols, $wgNoFollowLinks;
3737
3838 $lines = explode( "\n", $input );
3939
@@ -130,7 +130,7 @@
131131 if (is_null($title))
132132 return self::error('imagemap_invalid_title', $lineNum);
133133 $alt = $title->getFullText();
134 - } elseif ( $wgImageMapAllowExternalLinks && ( in_array( substr( $link , 1 , strpos($link, '//' )+1 ) , $wgUrlProtocols ) || in_array( substr( $link , 1 , strpos($link, ':' ) ) , $wgUrlProtocols ) ) ) {
 134+ } elseif ( in_array( substr( $link , 1 , strpos($link, '//' )+1 ) , $wgUrlProtocols ) || in_array( substr( $link , 1 , strpos($link, ':' ) ) , $wgUrlProtocols ) ) {
135135 if ( preg_match( '/^ \[ ([^\s]*+) \s ([^\]]*+) \] \w* $ /x', $link, $m ) ) {
136136 $title = htmlspecialchars( $m[1] );
137137 $alt = htmlspecialchars( trim( $m[2] ) );
Index: trunk/extensions/ImageMap/ImageMap.php
@@ -1,11 +1,5 @@
22 <?php
33
4 -/**
5 - * Set this to true to enable extern links [http://www.example.com] as
6 - * link destination
7 - */
8 -$wgImageMapAllowExternalLinks = false;
9 -
104 $wgExtensionFunctions[] = 'wfSetupImageMap';
115 $wgAutoloadClasses['ImageMap'] = dirname(__FILE__).'/ImageMap_body.php';
126 $wgExtensionCredits['parserhook']['ImageMap'] = array(

Status & tagging log