From 6dcfad8c5acbbd0782c615971a9d536c70d991e4 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 16 Jun 2026 14:37:31 +0800 Subject: [PATCH] fix: use ${param}$ SQL format in plugin queries --- plugins/cms_functions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/cms_functions.py b/plugins/cms_functions.py index 7674bd0..557cd91 100644 --- a/plugins/cms_functions.py +++ b/plugins/cms_functions.py @@ -51,9 +51,9 @@ async def get_published_content(content_type, limit=10): "c.tags, c.body, cat.name as category_name " "FROM cms_content c " "LEFT JOIN cms_categories cat ON c.category_id = cat.id " - "WHERE c.content_type = %(ct)s AND c.status = 'published' " + "WHERE c.content_type = ${ct}$ AND c.status = 'published' " "ORDER BY c.sort_order, c.created_at DESC " - "LIMIT %(lim)s", + "LIMIT ${lim}$", {"ct": content_type, "lim": int(limit)} ) return list(rows) @@ -73,7 +73,7 @@ async def get_latest_news(limit=3): "LEFT JOIN cms_categories cat ON c.category_id = cat.id " "WHERE c.content_type = 'news' AND c.status = 'published' " "ORDER BY c.published_at DESC, c.created_at DESC " - "LIMIT %(lim)s", + "LIMIT ${lim}$", {"lim": int(limit)} ) return list(rows)