Update mastodonapi.php

This commit is contained in:
simonpipe 2026-01-07 19:31:36 +01:00
parent dd8a402bb0
commit 55b41aad48

View file

@ -110,7 +110,6 @@ class YellowMastodonapi {
$fullPath = $this->yellow->system->get("coreServerDocument") . $targetFolder . $fileName; $fullPath = $this->yellow->system->get("coreServerDocument") . $targetFolder . $fileName;
if ( file_exists($fullPath) ) continue; if ( file_exists($fullPath) ) continue;
// Korrektur Blog-Ordner Rechte
if ( !is_dir(dirname($fullPath)) ) { if ( !is_dir(dirname($fullPath)) ) {
mkdir(dirname($fullPath), 0777, true); mkdir(dirname($fullPath), 0777, true);
chmod(dirname($fullPath), 0777); chmod(dirname($fullPath), 0777);
@ -134,6 +133,7 @@ class YellowMastodonapi {
$defaultAuthor, $defaultTag, $imageFilenames, $imageAltTexts, $statusSetting $defaultAuthor, $defaultTag, $imageFilenames, $imageAltTexts, $statusSetting
); );
file_put_contents($fullPath, $markdownContent); file_put_contents($fullPath, $markdownContent);
chmod($fullPath, 0666);
$postsCreated++; $postsCreated++;
} }
return $postsCreated; return $postsCreated;
@ -144,7 +144,6 @@ class YellowMastodonapi {
$imageUrl = $media["remote_url"] ?? $media["url"] ?? $media["preview_url"] ?? null; $imageUrl = $media["remote_url"] ?? $media["url"] ?? $media["preview_url"] ?? null;
if ( empty($imageUrl) ) return false; if ( empty($imageUrl) ) return false;
// Korrektur Bilder-Ordner Rechte
if ( !is_dir($dirPath) ) { if ( !is_dir($dirPath) ) {
mkdir($dirPath, 0777, true); mkdir($dirPath, 0777, true);
chmod($dirPath, 0777); chmod($dirPath, 0777);
@ -168,6 +167,7 @@ class YellowMastodonapi {
if ( !$imgData ) return false; if ( !$imgData ) return false;
file_put_contents($fullPath, $imgData); file_put_contents($fullPath, $imgData);
chmod($fullPath, 0666);
return $fileName; return $fileName;
} }