Fill in missing params from a dieUsage
[lhc/web/wiklou.git] / includes / Licenses.php
index b55dd1f..96ee124 100644 (file)
@@ -68,14 +68,9 @@ class Licenses extends HTMLFormField {
                }
        }
 
-       protected static function trimStars( $str ) {
-               $i = $count = 0;
-
-               $length = strlen( $str );
-               for ( $i = 0; $i < $length; $i++ ) {
-                       if ( $str[$i] != '*' )
-                               return array( $i, ltrim( $str, '* ' ) );
-               }
+       protected function trimStars( $str ) {
+               $numStars = strspn( $str, '*' );
+               return array( $numStars, ltrim( substr( $str, $numStars ), ' ' ) );
        }
 
        protected function stackItem( &$list, $path, $item ) {
@@ -171,7 +166,7 @@ class License {
         *
         * @param $str String: license name??
         */
-       function License( $str ) {
+       function __construct( $str ) {
                list( $text, $template ) = explode( '|', strrev( $str ), 2 );
 
                $this->template = strrev( $template );