Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php |
— | — | @@ -166,9 +166,8 @@ |
167 | 167 | $langs = self::getSupportedLanguages(); |
168 | 168 | $list = array(); |
169 | 169 | if( count( $langs ) > 0 ) { |
170 | | - for( $i = 0; $i < count( $langs ); $i++ ) { |
171 | | - if( preg_match( '!/([^\.]+)\.php$!u', $langs[$i], $m ) ) |
172 | | - $list[] = '<samp>' . $m[1] . '</samp>'; |
| 170 | + foreach( $langs as $lang ) { |
| 171 | + $list[] = '<samp>' . htmlspecialchars( $lang ) . '</samp>'; |
173 | 172 | } |
174 | 173 | return '<p style="padding: 0em 1em;">' . implode( ', ', $list ) . '</p>'; |
175 | 174 | } else { |
— | — | @@ -184,7 +183,10 @@ |
185 | 184 | private static function getSupportedLanguages() { |
186 | 185 | if( !is_array( self::$languages ) ) { |
187 | 186 | self::initialise(); |
188 | | - self::$languages = glob( GESHI_LANG_ROOT . "/*.php" ); |
| 187 | + self::$languages = array(); |
| 188 | + foreach( glob( GESHI_LANG_ROOT . "/*.php" ) as $file ) { |
| 189 | + self::$languages[] = basename( $file, '.php' ); |
| 190 | + } |
189 | 191 | sort( self::$languages ); |
190 | 192 | } |
191 | 193 | return self::$languages; |