mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-12-05 01:43:16 +00:00
Add checks for CLD2Detector ans CLD2Encoding classes
This commit is contained in:
parent
58180bd732
commit
d7d6a43655
1 changed files with 10 additions and 0 deletions
10
cld/cld.php
10
cld/cld.php
|
@ -22,6 +22,16 @@ function cld_detect_languages(array &$data)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!class_exists('CLD2Detector')) {
|
||||
Logger::warning('CLD2Detector class does not exist.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!class_exists('CLD2Encoding')) {
|
||||
Logger::warning('CLD2Encoding class does not exist.');
|
||||
return;
|
||||
}
|
||||
|
||||
$cld2 = new \CLD2Detector();
|
||||
|
||||
$cld2->setEncodingHint(CLD2Encoding::UTF8); // optional, hints about text encoding
|
||||
|
|
Loading…
Reference in a new issue