r104394 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104393‎ | r104394 | r104395 >
Date:05:37, 28 November 2011
Author:varnent
Status:deferred (Comments)
Tags:
Comment:
fix for possible PHP notices caused by r104388
Modified paths:
  • /trunk/extensions/AddThis/AddThis.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AddThis/AddThis.body.php
@@ -21,7 +21,12 @@
2222 <div class="addthis_toolbox addthis_default_style" id="addthistoolbar" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';">
2323 <a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-4eb75def4ec6488b" class="addthis_button_compact">&nbsp;' . $share . '</a><span class="addthis_separator">&nbsp;</span>';
2424 foreach ( $wgAddThisHServ as $n => $a ) {
25 - $output .= '<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'" '.$wgAddThisHServ[$n]["attribs"].'></a>';
 25+ if (true === isset($wgAddThisHServ[$n]["attribs"])) {
 26+ $output .= '<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'" '.$wgAddThisHServ[$n]["attribs"].'></a>';
 27+ }
 28+ else {
 29+ $output .= '<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'"></a>';
 30+ }
2631 }
2732 $output .='</div>
2833 <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script>
@@ -44,8 +49,13 @@
4550 $bar['addthis'] = '<!-- AddThis Button BEGIN -->
4651 <div class="addthis_toolbox addthis_default_style" id="addthissidebar">';
4752 foreach ( $wgAddThisSBServ as $n => $a ) {
48 - $bar['addthis'] .= '<a class="addthis_button_'.$wgAddThisSBServ[$n]["service"].'" '.$wgAddThisSBServ[$n]["attribs"].'></a>';
49 - }
 53+ if (true === isset($wgAddThisSBServ[$n]["attribs"])) {
 54+ $bar['addthis'] .= '<a class="addthis_button_'.$wgAddThisSBServ[$n]["service"].'" '.$wgAddThisSBServ[$n]["attribs"].'></a>';
 55+ }
 56+ else {
 57+ $bar['addthis'] .= '<a class="addthis_button_'.$wgAddThisSBServ[$n]["service"].'"></a>';
 58+ }
 59+ }
5060 $bar['addthis'] .= '</div>
5161 <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script>
5262 <!-- AddThis Button END -->';
@@ -81,7 +91,12 @@
8292 <div class="addthis_toolbox addthis_default_style" id="addthistoolbar" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';">
8393 <a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-4eb75def4ec6488b" class="addthis_button_compact">&nbsp;' . $share . '</a><span class="addthis_separator">&nbsp;</span>');
8494 foreach ( $wgAddThisHServ as $n => $a ) {
85 - $wgOut->addHTML('<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'" '.$wgAddThisHServ[$n]["attribs"].'></a>');
 95+ if (true === isset($wgAddThisHServ[$n]["attribs"])) {
 96+ $wgOut->addHTML('<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'" '.$wgAddThisHServ[$n]["attribs"].'></a>');
 97+ }
 98+ else {
 99+ $wgOut->addHTML('<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'"></a>');
 100+ }
86101 }
87102 $wgOut->addHTML('</div>
88103 <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script>

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104388improvement in use of arrays per feedback to r104384 - ty Johnduhartvarnent05:00, 28 November 2011

Comments

#Comment by Nikerabbit (talk | contribs)   09:09, 29 November 2011

if ( true === isset() ) is redundant, if ( isset() ) does the same.

Status & tagging log