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

corrected sql data

parent 7b917d1a
Loading
Loading
Loading
Loading
+9 −3
Changes for plugins/staticpage/static.cpp: 9 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -137,12 +137,18 @@ void blogi::StaticPage::editPage(libhttppp::HttpRequest* req, libhtmlpp::HtmlStr
        if(id>=0){
            for (libhttppp::HttpForm::MultipartFormData* curformdat = form.getMultipartFormData(); curformdat; curformdat = curformdat->nextMultipartFormData()) {
                libhttppp::HttpForm::MultipartFormData::ContentDisposition* curctdisp = curformdat->getContentDisposition();

                std::string data;

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

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