Fixing bug 27764. Adding an extra if-check to make sure ['text'] is defined. In To...
authorKrinkle <krinkle@users.mediawiki.org>
Tue, 22 Mar 2011 21:42:16 +0000 (21:42 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Tue, 22 Mar 2011 21:42:16 +0000 (21:42 +0000)
skins/Vector.php

index c67d3c2..5ee8f72 100644 (file)
@@ -365,8 +365,14 @@ class VectorTemplate extends BaseTemplate {
 <div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <h5><?php $this->msg('views') ?></h5>
        <ul<?php $this->html('userlangattributes') ?>>
-               <?php foreach ( $this->data['view_urls'] as $link ): ?>
-                       <li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo (array_key_exists('img',$link) ?  '<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : htmlspecialchars( $link['text'] ) ) ?></a></span></li>
+               <?php
+               foreach ( $this->data['view_urls'] as $link ): ?>
+                       <li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php
+                               // $link['text'] can be undefined - bug 27764
+                               if ( array_key_exists( 'text', $link ) ) {
+                                       echo array_key_exists( 'img', $link ) ?  '<img src="' . $link['img'] . '" alt="' . $link['text'] . '" />' : htmlspecialchars( $link['text'] );
+                               }
+                               ?></a></span></li>
                <?php endforeach; ?>
        </ul>
 </div>