r84565 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84564‎ | r84565 | r84566 >
Date:21:42, 22 March 2011
Author:krinkle
Status:ok
Tags:
Comment:
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) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -365,8 +365,14 @@
366366 <div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
367367 <h5><?php $this->msg('views') ?></h5>
368368 <ul<?php $this->html('userlangattributes') ?>>
369 - <?php foreach ( $this->data['view_urls'] as $link ): ?>
370 - <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>
 369+ <?php
 370+ foreach ( $this->data['view_urls'] as $link ): ?>
 371+ <li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php
 372+ // $link['text'] can be undefined - bug 27764
 373+ if ( array_key_exists( 'text', $link ) ) {
 374+ echo array_key_exists( 'img', $link ) ? '<img src="' . $link['img'] . '" alt="' . $link['text'] . '" />' : htmlspecialchars( $link['text'] );
 375+ }
 376+ ?></a></span></li>
371377 <?php endforeach; ?>
372378 </ul>
373379 </div>

Follow-up revisions

RevisionCommit summaryAuthorDate
r84566Follow-up r84565: Whitespacekrinkle21:44, 22 March 2011

Status & tagging log