Permalink
Browse files

sanitize user names on report form

  • Loading branch information...
benapetr committed Mar 12, 2015
1 parent f548529 commit 37ccf02de4459df17e3a222676dc604b1a38fae1
Showing with 9 additions and 2 deletions.
  1. +2 −2 huggle/reportuser.cpp
  2. +6 −0 huggle/wikiuser.cpp
  3. +1 −0 huggle/wikiuser.hpp
View
@@ -259,7 +259,7 @@ void ReportUser::Tick()
this->InsertUser();
// everything is ok we report user
QString summary = this->ReportedUser->GetSite()->GetProjectConfig()->ReportSummary;
summary = summary.replace("$1",this->ReportedUser->Username);
summary = summary.replace("$1", this->ReportedUser->Username);
this->qEdit = WikiUtil::EditPage(this->ReportedUser->GetSite()->GetProjectConfig()->AIVP, this->ReportContent, summary,
false, this->ReportTs);
this->ui->pushButton->setText(_l("report-write"));
@@ -533,7 +533,7 @@ void ReportUser::InsertUser()
{
text = this->ReportedUser->GetSite()->GetProjectConfig()->RUTemplateReport;
}
text = text.replace("$1", this->ReportedUser->Username);
text = text.replace("$1", this->ReportedUser->UnderscorelessUsername());
text = text.replace("$2", ReportText);
text = text.replace("$3", ui->lineEdit->text());
this->ReportContent = ReportContent + "\n" + text;
View
@@ -348,6 +348,12 @@ void WikiUser::ParseTP(QDate bt)
this->WarningLevel = HuggleParser::GetLevel(tp, bt, this->GetSite());
}
QString WikiUser::UnderscorelessUsername()
{
QString name = this->Username;
return name.replace("_", " ");
}
QString WikiUser::GetTalk()
{
// get a usertalk prefix for this site
View
@@ -82,6 +82,7 @@ namespace Huggle
void TalkPage_SetContents(QString text);
//! Call UpdateUser on current user
void Update(bool MatchingOnly = false);
QString UnderscorelessUsername();
void Sanitize();
/*!
* \brief Change the IP property to true forcefully even if user isn't IP

0 comments on commit 37ccf02

Please sign in to comment.