From: Ævar Arnfjörð Bjarmason Date: Wed, 31 Aug 2005 14:19:01 +0000 (+0000) Subject: * Fixed a bug, array_slice() called incorrectly X-Git-Tag: 1.6.0~1748 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=75cb2b36b342a92fb0180c95c0d39f9e7630bd29;p=lhc%2Fweb%2Fwiklou.git * Fixed a bug, array_slice() called incorrectly --- 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(