From 75cb2b36b342a92fb0180c95c0d39f9e7630bd29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Wed, 31 Aug 2005 14:19:01 +0000 Subject: [PATCH] * Fixed a bug, array_slice() called incorrectly --- includes/Licenses.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Licenses.php b/includes/Licenses.php index 316aacd0f0..2f0b1ae14c 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -63,12 +63,11 @@ class Licenses { $this->stackItem( $this->licenses, $levels, $obj ); } else { if ( $level < count( $levels ) ) - $levels = array_slice( $levels, count( $levels ) - $level ); + $levels = array_slice( $levels, 0, $level ); if ( $level == count( $levels ) ) $levels[$level - 1] = $line; else if ( $level > count( $levels ) ) $levels[] = $line; - } } } @@ -77,8 +76,10 @@ class Licenses { function trimStars( $str ) { $i = $count = 0; + wfSuppressWarnings(); while ($str[$i++] == '*') ++$count; + wfRestoreWarnings(); return array( $count, ltrim( $str, '* ' ) ); } @@ -96,7 +97,6 @@ class Licenses { function makeHtml( &$tagset, $depth = 0 ) { foreach ( $tagset as $key => $val ) if ( is_array( $val ) ) { - $this->html .= $this->outputOption( $this->msg( $key ), array( -- 2.20.1