feat : magic link confirm, notif auteur, rate-limit IP, duplicate, cache MD, lazy img (v1.6.18)
- magic.php : GET=confirmation page, POST=consommation (protège vs scanners) (#27) - verify_comment : email de notification à l'auteur de l'article (#44) - login/index.php : rate limit par IP (MAGIC_MAX_PER_IP_HOUR=10) (#23) - ArticleManager::duplicate() + route POST /duplicate/{uuid} + bouton ⧉ admin/articles (#7) - post_view.php : cache JSON du rendu Markdown (invalidé sur mtime index.md) (#17) - post_view.php : loading="lazy" sur toutes les <img> du contenu (#21) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,21 @@ class ArticleManager
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
/** Crée un brouillon en copiant titre, contenu, catégorie et tags d'un article existant. */
|
||||
public function duplicate(string $sourceUuid, string $author = ''): ?string
|
||||
{
|
||||
$source = $this->getByUuid($sourceUuid);
|
||||
if (!$source) {
|
||||
return null;
|
||||
}
|
||||
$newTitle = 'Copie de ' . ($source['title'] ?? '');
|
||||
$content = $source['content'] ?? '';
|
||||
$category = $source['category'] ?? '';
|
||||
$tags = $source['tags'] ?? [];
|
||||
$newAuthor = $author !== '' ? $author : ($source['author'] ?? '');
|
||||
return $this->create($newTitle, $content, false, '', '', $newAuthor, '', '', '', $category, $tags);
|
||||
}
|
||||
|
||||
public function update(string $uuid, string $title, string $content, bool $published, string $slug, string $publishedAt, string $revisionComment = '', string $seoTitle = '', string $seoDescription = '', string $ogImage = '', string $category = '', ?array $tags = null, bool $skipGit = false): void
|
||||
{
|
||||
$article = $this->getByUuid($uuid);
|
||||
|
||||
Reference in New Issue
Block a user