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

HtmlEncode support added

parent efbd1c42
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
@@ -139,16 +139,19 @@ void blogi::StaticPage::editPage(libhttppp::HttpRequest* req, libhtmlpp::HtmlStr
                libhttppp::HttpForm::MultipartFormData::ContentDisposition* curctdisp = curformdat->getContentDisposition();

                std::string data;
                libhtmlpp::HtmlString result;

                std::copy(curformdat->getData(),curformdat->getData()+curformdat->getDataSize(),
                         std::inserter<std::string>(data,data.begin()));

                libhtmlpp::HtmlEncode(data.c_str(),result);

                if(strcmp(curctdisp->getName(),"url")==0){
                    sql<< "update static_content set url='" << data.c_str() << "' where id='" << id <<"'; ";
                    sql<< "update static_content set url='" << result.c_str() << "' where id='" << id <<"'; ";
                }else if(strcmp(curctdisp->getName(),"meta")==0){
                    sql<< "update static_content set meta='" << data.c_str() << "' where id='" << id <<"'; ";
                    sql<< "update static_content set meta='" << result.c_str() << "' where id='" << id <<"'; ";
                }else if(strcmp(curctdisp->getName(),"text")==0){
                    sql<< "update static_content set text='" << data.c_str() << "' where id='" << id <<"'; ";
                    sql<< "update static_content set text='" << result.c_str() << "' where id='" << id <<"'; ";
                }
            }

+5 −4
Changes for src/blogi.cpp: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ void blogi::Blogi::RequestEvent(netplus::con *curcon){
            << "Seite oder Inhalt nicht gefudnen"
            << "</span><br/><a style=\"text-decoration: none; color: rgb(58,212, 58);\" href=\""
            <<  PlgArgs->config->getstartpage()
            << "\" >Zur&uuml;ck zur Startseite</a></html></body>";
            << "\" >Zur&uuml;ck zur Startseite</a></body></html>";
            libhtmlpp::print(err.parse(),nullptr,output);
            libhttppp::HttpResponse resp;
            resp.setVersion(HTTPVERSION(1.1));
@@ -281,12 +281,13 @@ void blogi::Blogi::RequestEvent(netplus::con *curcon){
        }
    }catch(libhttppp::HTTPException &e){
        std::string output;
        libhtmlpp::HtmlString err;
        libhtmlpp::HtmlString err,hreason;
        libhtmlpp::HtmlEncode(e.what(),hreason);
        err << "<!DOCTYPE html><html><body style=\"color:rgb(238, 238, 238); background:rgb(35, 38, 39);\"><span>"
        << e.what()
        << hreason
        << "</span><br/><a style=\"text-decoration: none; color: rgb(58,212, 58);\" href=\""
        <<  PlgArgs->config->getstartpage()
        << "\" >Zur&uuml;ck zur Startseite</a></html></body>";
        << "\" >Zur&uuml;ck zur Startseite</a></body></html>";
        libhtmlpp::print(err.parse(),nullptr,output);
        libhttppp::HttpResponse resp;
        resp.setVersion(HTTPVERSION(1.1));