From: Ævar Arnfjörð Bjarmason Date: Fri, 30 Dec 2005 17:27:46 +0000 (+0000) Subject: * Formatting X-Git-Tag: 1.6.0~838 X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=commitdiff_plain;h=8f3c836b858068112c5670bcc6156e73bcbedd96;p=lhc%2Fweb%2Fwiklou.git * Formatting --- diff --git a/includes/Licenses.php b/includes/Licenses.php index 36b5a7e846..4294e2f489 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -54,26 +54,24 @@ class Licenses { $lines = explode( "\n", $this->msg ); foreach ( $lines as $line ) { - if ( strpos( $line, '*' ) !== 0 ) { + if ( strpos( $line, '*' ) !== 0 ) continue; - } else { + else { list( $level, $line ) = $this->trimStars( $line ); if ( strpos( $line, '|' ) !== false ) { $obj = new License( $line ); $this->stackItem( $this->licenses, $levels, $obj ); } else { - if ( $level < count( $levels ) ) { + if ( $level < count( $levels ) ) $levels = array_slice( $levels, 0, $level ); - } - if ( $level == count( $levels ) ) { + if ( $level == count( $levels ) ) $levels[$level - 1] = $line; - } elseif ( $level > count( $levels ) ) { + else if ( $level > count( $levels ) ) $levels[] = $line; - } } } - } // end foreach + } } function trimStars( $str ) {