Demon has submitted this change and it was merged.
Change subject: Fix E_NOTICE and remove error suppression operators
......................................................................
Fix E_NOTICE and remove error suppression operators
Change-Id: I092ba43dc065b2a4275bb8773034f6dc506129bb
---
M WikiCategoryTagCloud.php
1 file changed, 10 insertions(+), 13 deletions(-)
Approvals:
Demon: Verified; Looks good to me, approved
diff --git a/WikiCategoryTagCloud.php b/WikiCategoryTagCloud.php
index f93cacf..2efec19 100644
--- a/WikiCategoryTagCloud.php
+++ b/WikiCategoryTagCloud.php
@@ -72,11 +72,12 @@
$dbr = wfGetDB( DB_SLAVE );
- $cloud_style = @$params['style'];
- $cloud_classes = preg_split( '/\s+/', @$params['class'] );
- array_unshift( $cloud_classes, 'tagcloud' );
- $link_style = $params['linkstyle'];
- $link_classes = preg_split( '/\s+/', @$params['linkclass'] );
+ $params += array(
+ 'style' => '',
+ 'class' => '',
+ 'linkstyle' => '',
+ 'linkclass' => '',
+ );
$min_count_input = getBoxExtensionOption( $input, 'min_count' );
$min_size_input = getBoxExtensionOption( $input, 'min_size' );
$increase_factor_input = getBoxExtensionOption( $input,
'increase_factor' );
@@ -114,7 +115,7 @@
$count = $dbr->numRows( $res );
$htmlOut = '';
- $htmlOut = $htmlOut . '<div class="' . implode( ' ', $cloud_classes ) .
"\" style=\"{$cloud_style}\">";
+ $htmlOut .= '<div class="tagcloud '.$params['class'].'"
style="'.$params['style'].'">';
$min = 1000000;
$max = - 1;
@@ -134,13 +135,9 @@
for ( $i = 0; $i < $count; $i++ ) {
$textSize = $MIN_SIZE + ( $INCREASE_FACTOR * ( $tags[$i][1] ) )
/ ( $max );
$title = Title::makeTitle( NS_CATEGORY, $tags[$i][0] );
- $style = $link_style;
- if ( $style != '' && substr( $style, -1 ) != ';' ) {
- $style .= ';';
- }
- $style .= "font-size: {$textSize}%;";
- $currentRow = '<a class="' . implode( ' ', $link_classes ) .
- "\" style=\"{$style}\" href=\"" . $title->getLocalURL()
. '">' .
+ $style = 'font-size: '.$textSize.'%; '.$params['linkstyle'];
+ $currentRow = '<a class="' . $params['linkclass'] .
+ '" style="' . $style . '" href="' .
$title->getLocalURL() . '">' .
$title->getText() . '</a>  ';
$htmlOut = $htmlOut . $currentRow;
}
--
To view, visit https://gerrit.wikimedia.org/r/34216
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I092ba43dc065b2a4275bb8773034f6dc506129bb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikiCategoryTagCloud
Gerrit-Branch: master
Gerrit-Owner: VitaliyFilippov <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: VitaliyFilippov <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits