Fix last 3 errors

pull/1581/head
Art4 2024-12-09 23:08:31 +00:00
parent cfb6b3123f
commit fff140ad43
3 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,6 @@
* *
*/ */
use Friendica\App;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI; use Friendica\DI;
@ -79,6 +78,7 @@ function get_body_length($body)
* Checking any possible syntax of the style attribute with xpath is impossible * Checking any possible syntax of the style attribute with xpath is impossible
* So we just get any element with a style attribute, and check them with a regexp * So we just get any element with a style attribute, and check them with a regexp
*/ */
/** @var DOMNodeList $xr */
$xr = $xpath->query('//*[@style]'); $xr = $xpath->query('//*[@style]');
foreach ($xr as $node) { foreach ($xr as $node) {
if (preg_match('/.*display: *none *;.*/',$node->getAttribute('style'))) { if (preg_match('/.*display: *none *;.*/',$node->getAttribute('style'))) {

View File

@ -54,6 +54,8 @@ unset($id);
* *
* @package codebird * @package codebird
* @subpackage codebird-php * @subpackage codebird-php
*
* @method object statuses_update(array $postdata)
*/ */
class CodebirdSN class CodebirdSN
{ {

View File

@ -26,6 +26,7 @@ function tesseract_ocr_detection(&$media)
try { try {
$languages = $ocr->availableLanguages(); $languages = $ocr->availableLanguages();
if ($languages) { if ($languages) {
/** @phpstan-ignore-next-line ignore call of \thiagoalessio\TesseractOCR\Option::lang() */
$ocr->lang(implode('+', $languages)); $ocr->lang(implode('+', $languages));
} }
$ocr->tempDir(System::getTempPath()); $ocr->tempDir(System::getTempPath());
@ -33,5 +34,5 @@ function tesseract_ocr_detection(&$media)
$media['description'] = $ocr->run(); $media['description'] = $ocr->run();
} catch (\Throwable $th) { } catch (\Throwable $th) {
Logger::info('Error calling TesseractOCR', ['message' => $th->getMessage()]); Logger::info('Error calling TesseractOCR', ['message' => $th->getMessage()]);
} }
} }