http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69056

Revision: 69056
Author:   jeroendedauw
Date:     2010-07-05 14:28:01 +0000 (Mon, 05 Jul 2010)

Log Message:
-----------
Fixed bug in width and height validation when using % and backward 
compatibility issue

Modified Paths:
--------------
    trunk/extensions/Maps/Includes/Maps_Mapper.php
    trunk/extensions/Maps/Maps.php

Modified: trunk/extensions/Maps/Includes/Maps_Mapper.php
===================================================================
--- trunk/extensions/Maps/Includes/Maps_Mapper.php      2010-07-05 14:24:37 UTC 
(rev 69055)
+++ trunk/extensions/Maps/Includes/Maps_Mapper.php      2010-07-05 14:28:01 UTC 
(rev 69056)
@@ -168,7 +168,7 @@
 
                // Determine the minimum and maximum values.
                if ( preg_match( '/^.*%$/', $value ) ) {
-                       if ( count( $egMapsSizeRestrictions[$dimension] >= 4 ) 
) {
+                       if ( count( $egMapsSizeRestrictions[$dimension] ) >= 4 
) {
                                $min = $egMapsSizeRestrictions[$dimension][2];
                                $max = $egMapsSizeRestrictions[$dimension][3];
                        } else {
@@ -183,15 +183,15 @@
 
                // See if the actual value is withing the limits.
                $number = preg_replace( '/[^0-9]/', '', $value );
-               if ( $number < $egMapsSizeRestrictions[$dimension][0] ) {
+               if ( $number < $min ) {
                        if ( $correct ) {
-                               $value = $egMapsSizeRestrictions[$dimension][0];
+                               $value = $min;
                        } else {
                                return false;
                        }
-               } else if ( $number > $egMapsSizeRestrictions[$dimension][1] ) {
+               } else if ( $number > $max ) {
                        if ( $correct ) {
-                               $value = $egMapsSizeRestrictions[$dimension][1];
+                               $value = $max;
                        } else {
                                return false;
                        }

Modified: trunk/extensions/Maps/Maps.php
===================================================================
--- trunk/extensions/Maps/Maps.php      2010-07-05 14:24:37 UTC (rev 69055)
+++ trunk/extensions/Maps/Maps.php      2010-07-05 14:28:01 UTC (rev 69056)
@@ -33,7 +33,7 @@
        echo '<b>Warning:</b> You need to have <a 
href="http://www.mediawiki.org/wiki/Extension:Validator";>Validator</a> 
installed in order to use <a 
href="http://www.mediawiki.org/wiki/Extension:Maps";>Maps</a>.';
 }
 else {
-       define( 'Maps_VERSION', '0.6.4 a8' );
+       define( 'Maps_VERSION', '0.6.4 a9' );
 
        // The different coordinate notations.
        define( 'Maps_COORDS_FLOAT', 'float' );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to