Defect #26055 » 0003-Use-stored-ref.-to-array-holding-supported-languages.patch
| lib/redmine/syntax_highlighting.rb | ||
|---|---|---|
| 64 | 64 |
end |
| 65 | 65 |
private_class_method :retrieve_supported_languages |
| 66 | 66 | |
| 67 |
SUPPORTED_LANGUAGES = retrieve_supported_languages |
|
| 68 | ||
| 67 | 69 |
class << self |
| 68 | 70 |
# Highlights +text+ as the content of +filename+ |
| 69 | 71 |
# Should not return line numbers nor outer pre tag |
| ... | ... | |
| 79 | 81 |
end |
| 80 | 82 | |
| 81 | 83 |
def language_supported?(language) |
| 82 |
supported_languages = retrieve_supported_languages |
|
| 83 |
supported_languages.include?(language.to_s.downcase.to_sym) |
|
| 84 |
SUPPORTED_LANGUAGES.include?(language.to_s.downcase.to_sym) |
|
| 84 | 85 |
rescue |
| 85 | 86 |
false |
| 86 | 87 |
end |