|
@ -124,11 +124,11 @@ class SendToCore implements ShouldQueue |
|
|
|
|
|
|
|
|
protected function getContent() |
|
|
protected function getContent() |
|
|
{ |
|
|
{ |
|
|
$extension = $this->fileResultType === 'md' ? 'md' : 'json'; |
|
|
|
|
|
|
|
|
$extension = $this->fileResultType === 'html' ? 'html' : []; |
|
|
$filePath = "$this->directoryPath/document.$extension"; |
|
|
$filePath = "$this->directoryPath/document.$extension"; |
|
|
|
|
|
|
|
|
$document = $this->storage->get($filePath); |
|
|
$document = $this->storage->get($filePath); |
|
|
$document = $this->encodeContent($document); |
|
|
|
|
|
|
|
|
// $document = $this->encodeContent($document);
|
|
|
|
|
|
|
|
|
$images = []; |
|
|
$images = []; |
|
|
|
|
|
|
|
@ -154,14 +154,14 @@ class SendToCore implements ShouldQueue |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected function encodeContent($content) |
|
|
|
|
|
{ |
|
|
|
|
|
$encoding = mb_detect_encoding($content, 'UTF-8, ISO-8859-1, WINDOWS-1252, WINDOWS-1251', true); |
|
|
|
|
|
|
|
|
// protected function encodeContent($content)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// $encoding = mb_detect_encoding($content, 'UTF-8, ISO-8859-1, WINDOWS-1252, WINDOWS-1251', true);
|
|
|
|
|
|
|
|
|
if ($encoding != 'UTF-8') { |
|
|
|
|
|
$content = iconv($encoding, 'UTF-8//IGNORE', $content); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// if ($encoding != 'UTF-8') {
|
|
|
|
|
|
// $content = iconv($encoding, 'UTF-8//IGNORE', $content);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
return $content; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// return $content;
|
|
|
|
|
|
// }
|
|
|
} |
|
|
} |