Fix $count to === against array instead of using count that fails

Bug: T195613
Change-Id: I3f38ae8f5f322c49639b23126f990854f6a6549f
isekai
Paladox 7 years ago
parent e1c93cb5f4
commit 6b9616d1ca

@ -181,7 +181,7 @@ class TimelessTemplate extends BaseTemplate {
if ( is_array( $content ) ) {
$contentText = Html::openElement( 'ul' );
if ( count( $content ) > 0 ) {
if ( $content !== [] ) {
foreach ( $content as $key => $item ) {
$contentText .= $this->makeListItem(
$key,
@ -199,7 +199,7 @@ class TimelessTemplate extends BaseTemplate {
$html = Html::rawElement( 'div', [
'role' => 'navigation',
'class' => [ 'mw-portlet', 'emptyPortlet' => count( $content ) === 0 ],
'class' => [ 'mw-portlet', 'emptyPortlet' => (bool)$content ],
'id' => Sanitizer::escapeId( 'p-' . $name ),
'title' => Linker::titleAttrib( 'p-' . $name ),
'aria-labelledby' => $labelId
@ -733,7 +733,7 @@ class TimelessTemplate extends BaseTemplate {
$allCats[$i] = substr( $catName, $len );
}
}
if ( count( $allCats ) > 0 ) {
if ( $allCats !== [] ) {
$dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
[ 'page', 'page_props' ],

Loading…
Cancel
Save