Commit a96aa3b8 authored by jan.koester's avatar jan.koester
Browse files

test

parent 37efe51e
Loading
Loading
Loading
Loading
+6 −3
Changes for plugins/staticpage/static.cpp: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -749,6 +749,7 @@ void blogi::StaticPage::Publish(const int tid, const std::string &html, json_obj

    std::string url, meta, method, navbarLabel, llmsTxt;
    std::string navbarId;
    bool hasLlmsTxt = false;

    if (params) {
        if (json_object_object_get_ex(params, "url", &val_obj)) {
@@ -761,6 +762,7 @@ void blogi::StaticPage::Publish(const int tid, const std::string &html, json_obj
        }
        if (json_object_object_get_ex(params, "llms_txt", &val_obj)) {
            const char *v = json_object_get_string(val_obj);
            hasLlmsTxt = true;
            if (v) llmsTxt = v;
        }
        if (json_object_object_get_ex(params, "method", &val_obj)) {
@@ -798,9 +800,10 @@ void blogi::StaticPage::Publish(const int tid, const std::string &html, json_obj
            std::string pageId = res[0][0];
            sql.clear();
            sql << "UPDATE static_content SET text='" << dbpp::SQL::escaped(sbuf, html.c_str())
                << "', meta='" << dbpp::SQL::escaped(sbuf, meta.c_str())
                << "', llms_txt='" << dbpp::SQL::escaped(sbuf, llmsTxt.c_str())
                << "' WHERE id='" << pageId.c_str() << "';";
                << "', meta='" << dbpp::SQL::escaped(sbuf, meta.c_str()) << "'";
            if (hasLlmsTxt)
                sql << ", llms_txt='" << dbpp::SQL::escaped(sbuf, llmsTxt.c_str()) << "'";
            sql << " WHERE id='" << pageId.c_str() << "';";
            Args->database[tid]->exec(sql, res);

            json_object_object_add(response, "status", json_object_new_string("success"));