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

Revision: 84565
Author:   krinkle
Date:     2011-03-22 21:42:16 +0000 (Tue, 22 Mar 2011)
Log Message:
-----------
Fixing bug 27764. Adding an extra if-check to make sure ['text'] is defined. In 
To avoid wrapping multiple 'if shorthands', converted it to an actual 
if-statement at the same time

Modified Paths:
--------------
    trunk/phase3/skins/Vector.php

Modified: trunk/phase3/skins/Vector.php
===================================================================
--- trunk/phase3/skins/Vector.php       2011-03-22 21:42:15 UTC (rev 84564)
+++ trunk/phase3/skins/Vector.php       2011-03-22 21:42:16 UTC (rev 84565)
@@ -365,8 +365,14 @@
 <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>


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

Reply via email to