Loading plugins/staticpage/static.cpp +14 −15 Changes for plugins/staticpage/static.cpp: 14 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -137,13 +137,13 @@ void blogi::StaticPage::newPage(const int tid,libhttppp::HttpRequest& req, libht std::copy(curformdat->Value.begin(),curformdat->Value.end(), std::inserter<std::string>(data,data.begin())); if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"url")==0){ if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"url")){ libhtmlpp::HtmlEncode(data.c_str(),&result); surl=result.c_str(); }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"meta")==0){ }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"meta")){ libhtmlpp::HtmlEncode(data.c_str(),&result); meta=result.c_str(); }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"text")==0){ }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"text")){ text=data; } } Loading @@ -155,11 +155,16 @@ void blogi::StaticPage::newPage(const int tid,libhttppp::HttpRequest& req, libht id.generate(); sql << "INSERT INTO static_content (id,url,meta,text) VALUES('" << "'" << id.c_str() << "'," << sql.escaped(sbuf,surl.c_str()) << "','" << sql.escaped(sbuf,meta.c_str()) << "','" << sql.escaped(sbuf,text.c_str()) <<"');"; << id.c_str() << "\',\'" << sql.escaped(sbuf,surl.c_str()) << "\',\'" << sql.escaped(sbuf,meta.c_str()) << "\',\'" << sql.escaped(sbuf,text.c_str()) <<"\');"; try{ Args->database[tid]->exec(sql,res); }catch(const char *e){ std::cerr << e << std::endl; return; } sql.clear(); setdiv << "<div id=\"staticsettings\"><span>Added succesfully! </span></div>"; }else{ Loading @@ -177,7 +182,8 @@ void blogi::StaticPage::newPage(const int tid,libhttppp::HttpRequest& req, libht setdiv << "<input name=\"url\" type=\"text\" value=\""<< surl <<"\" /><br>"; setdiv << "<span>Meta:</span><br>" << "<textarea name=\"meta\" style=\"width:95%; height:200px;\"> Schlagwörter für Google </textarea><br>" << "<span>Content:</span><br>"; << "<span>Content:</span><br>" << "<textarea name=\"text\" style=\"width:95%; height:400px;\"></textarea><br>"; setdiv<< "<button type=\"submit\" formaction=\"" << Args->config->buildurl("settings/staticpage",url,512) << "\">Back</button>" << "<input type=\"submit\" value=\"Save\">" << "</form></div>"; Loading @@ -198,13 +204,6 @@ void blogi::StaticPage::delPage(const int tid,libhttppp::HttpRequest& req, libht for(libhttppp::HttpForm::UrlcodedForm::Data *cdat=form.UrlFormData.getFormData(); cdat; cdat=cdat->nextData()){ if(cdat->getKey()=="pageid"){ size_t pgidlen=cdat->getValue().length(); for(size_t i =0; i<pgidlen; ++i){ if(!isdigit(cdat->getValue()[i])){ libhttppp::HTTPException excep; excep[libhttppp::HTTPException::Error] << "Wrong formted Pageid!"; throw excep; } } id.parse(cdat->getValue().c_str()); }else if(cdat->getKey()=="confirmed"){ if(cdat->getValue()=="true") Loading Loading
plugins/staticpage/static.cpp +14 −15 Changes for plugins/staticpage/static.cpp: 14 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -137,13 +137,13 @@ void blogi::StaticPage::newPage(const int tid,libhttppp::HttpRequest& req, libht std::copy(curformdat->Value.begin(),curformdat->Value.end(), std::inserter<std::string>(data,data.begin())); if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"url")==0){ if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"url")){ libhtmlpp::HtmlEncode(data.c_str(),&result); surl=result.c_str(); }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"meta")==0){ }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"meta")){ libhtmlpp::HtmlEncode(data.c_str(),&result); meta=result.c_str(); }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"text")==0){ }else if(std::equal(curctdisp->getValue().begin(),curctdisp->getValue().end(),"text")){ text=data; } } Loading @@ -155,11 +155,16 @@ void blogi::StaticPage::newPage(const int tid,libhttppp::HttpRequest& req, libht id.generate(); sql << "INSERT INTO static_content (id,url,meta,text) VALUES('" << "'" << id.c_str() << "'," << sql.escaped(sbuf,surl.c_str()) << "','" << sql.escaped(sbuf,meta.c_str()) << "','" << sql.escaped(sbuf,text.c_str()) <<"');"; << id.c_str() << "\',\'" << sql.escaped(sbuf,surl.c_str()) << "\',\'" << sql.escaped(sbuf,meta.c_str()) << "\',\'" << sql.escaped(sbuf,text.c_str()) <<"\');"; try{ Args->database[tid]->exec(sql,res); }catch(const char *e){ std::cerr << e << std::endl; return; } sql.clear(); setdiv << "<div id=\"staticsettings\"><span>Added succesfully! </span></div>"; }else{ Loading @@ -177,7 +182,8 @@ void blogi::StaticPage::newPage(const int tid,libhttppp::HttpRequest& req, libht setdiv << "<input name=\"url\" type=\"text\" value=\""<< surl <<"\" /><br>"; setdiv << "<span>Meta:</span><br>" << "<textarea name=\"meta\" style=\"width:95%; height:200px;\"> Schlagwörter für Google </textarea><br>" << "<span>Content:</span><br>"; << "<span>Content:</span><br>" << "<textarea name=\"text\" style=\"width:95%; height:400px;\"></textarea><br>"; setdiv<< "<button type=\"submit\" formaction=\"" << Args->config->buildurl("settings/staticpage",url,512) << "\">Back</button>" << "<input type=\"submit\" value=\"Save\">" << "</form></div>"; Loading @@ -198,13 +204,6 @@ void blogi::StaticPage::delPage(const int tid,libhttppp::HttpRequest& req, libht for(libhttppp::HttpForm::UrlcodedForm::Data *cdat=form.UrlFormData.getFormData(); cdat; cdat=cdat->nextData()){ if(cdat->getKey()=="pageid"){ size_t pgidlen=cdat->getValue().length(); for(size_t i =0; i<pgidlen; ++i){ if(!isdigit(cdat->getValue()[i])){ libhttppp::HTTPException excep; excep[libhttppp::HTTPException::Error] << "Wrong formted Pageid!"; throw excep; } } id.parse(cdat->getValue().c_str()); }else if(cdat->getKey()=="confirmed"){ if(cdat->getValue()=="true") Loading