MediaWiki r41730 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r41729‎ | r41730 (on ViewVC)‎ | r41731 >
Date:07:03, 6 October 2008
Author:tstarling
Status:old
Tags:
Comment:
Fixed bug 15675: show an error if a polygon has an odd number of coordinates.
Modified paths:

Diff [purge]

Index: trunk/extensions/ImageMap/ImageMap_body.php
===================================================================
--- trunk/extensions/ImageMap/ImageMap_body.php	(revision 41729)
+++ trunk/extensions/ImageMap/ImageMap_body.php	(revision 41730)
@@ -192,6 +192,9 @@
 					if ( !count( $coords ) ) {
 						return self::error( 'imagemap_missing_coord', $lineNum );
 					}
+					if ( count( $coords ) % 2 !== 0 ) {
+						return self::error( 'imagemap_poly_odd', $lineNum );
+					}
 					break;
 				default:
 					return self::error( 'imagemap_unrecognised_shape', $lineNum );
Index: trunk/extensions/ImageMap/ImageMap.i18n.php
===================================================================
--- trunk/extensions/ImageMap/ImageMap.i18n.php	(revision 41729)
+++ trunk/extensions/ImageMap/ImageMap.i18n.php	(revision 41730)
@@ -25,6 +25,7 @@
 	'imagemap_description'          => 'About this image',
 	# Note to translators: keep the same order
 	'imagemap_desc_types'           => 'top-right, bottom-right, bottom-left, top-left, none',
+	'imagemap_poly_odd'             => 'Error: found poly with odd number of coordinates on line $1',
 );
 
 /** Message documentation (Message documentation)

Status & tagging log

  • 15:32, 12 September 2011 Meno25 (Talk | contribs) changed the status of r41730 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox