diff --git a/data/LanguageNameSearch.php b/data/LanguageNameSearch.php index 6d882ec5..3aa5e7b4 100644 --- a/data/LanguageNameSearch.php +++ b/data/LanguageNameSearch.php @@ -18,7 +18,7 @@ * @licence MIT License */ class LanguageNameSearch { - static $languagenames; + protected static $languagenames; public static function init() { self::$languagenames = unserialize( file_get_contents( __DIR__ . '/langnames.ser' ) ); @@ -74,11 +74,12 @@ class LanguageNameSearch { static function getCodepoint( $str ) { $values = array(); $lookingFor = 1; - for ( $i = 0; $i < strlen( $str ); $i++ ) { + $strLen = strlen( $str ); + for ( $i = 0; $i < $strLen; $i++ ) { $thisValue = ord( $str[$i] ); if ( $thisValue < 128 ) { return $thisValue; - } else { // Codepoints larger than 127 are represented by multi-byte sequences, + } else { // Codepoints larger than 127 are represented by multi-byte sequences if ( count( $values ) === 0 ) { // 224 is the lowest non-overlong-encoded codepoint. $lookingFor = ( $thisValue < 224 ) ? 2 : 3; diff --git a/data/fontrepo/scripts/compile.php b/data/fontrepo/scripts/compile.php index 6f3c19da..3472909f 100644 --- a/data/fontrepo/scripts/compile.php +++ b/data/fontrepo/scripts/compile.php @@ -51,7 +51,7 @@ foreach ( glob( '../fonts/*/font.ini' ) as $inifile ) { $dir = dirname( $inifile ); if ( isset( $font['ttf'] ) ) { - $list['fonts'][$fontname]['ttf'] = basename( $dir ) . '/' . $font['ttf'] ; + $list['fonts'][$fontname]['ttf'] = basename( $dir ) . '/' . $font['ttf']; } if ( isset( $font['svg'] ) ) { $list['fonts'][$fontname]['svg'] = basename( $dir ) . '/' . $font['svg']; @@ -89,7 +89,7 @@ ksort( $list['fonts'] ); $json = json_encode( $list ); $js = <<