Handle conflicting image format options in predictable way.
[lhc/web/wiklou.git] / includes / parser / Parser.php
index f2c4fbf..29fde6c 100644 (file)
@@ -5329,6 +5329,7 @@ class Parser {
                $caption = '';
                $params = array( 'frame' => array(), 'handler' => array(),
                        'horizAlign' => array(), 'vertAlign' => array() );
+               $seenformat = false;
                foreach ( $parts as $part ) {
                        $part = trim( $part );
                        list( $magicName, $value ) = $mwArray->matchVariableStartToEnd( $part );
@@ -5396,6 +5397,13 @@ class Parser {
                                                                }
                                                        }
                                                        break;
+                                               case 'frameless':
+                                               case 'framed':
+                                               case 'thumbnail':
+                                                       // use first appearing option, discard others.
+                                                       $validated = ! $seenformat;
+                                                       $seenformat = true;
+                                                       break;
                                                default:
                                                        # Most other things appear to be empty or numeric...
                                                        $validated = ( $value === false || is_numeric( trim( $value ) ) );