aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models/WikiModel.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Models/WikiModel.php')
-rw-r--r--h-source/Application/Models/WikiModel.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php
index 3e768d3..3e2a4a9 100644
--- a/h-source/Application/Models/WikiModel.php
+++ b/h-source/Application/Models/WikiModel.php
@@ -98,7 +98,7 @@ class WikiModel extends Model_Map {
$this->lastId = $clean['id'];
$this->lastTitle = $resId[0]['wiki']['title'];
$this->lastTitleClean = titleForRedirect($resId[0]['wiki']['title']);
- $this->db->update('wiki','title_clean',array(encodeUrl($resId[0]['wiki']['title'])),'id_wiki='.$clean['id']);
+ $this->db->update('wiki','title_clean',array(encodeUrl(sanitizeDb($resId[0]['wiki']['title']))),'id_wiki='.$clean['id']);
//update the history table
$this->updateHistory('insert');
@@ -126,6 +126,9 @@ class WikiModel extends Model_Map {
$revisions = new WikirevisionsModel();
$revisions->values = $oldValues;
+
+ $revisions->sanitize();
+
if ($revisions->insert())
{
@@ -156,6 +159,7 @@ class WikiModel extends Model_Map {
public function makeCurrent($id_rev)
{
+
$clean['id_rev'] = (int)$id_rev;
$revisions = new WikirevisionsModel();
@@ -175,11 +179,14 @@ class WikiModel extends Model_Map {
if (count($newStruct > 0))
{
$revisions->values = $oldStruct[0]['wiki'];
-
+ $revisions->sanitize();
+
$this->values = $newStruct[0]['wiki_revisions'];
$this->values['created_by'] = (int)$this->id_user;
$this->values['update_date'] = date('Y-m-d H:i:s');
+ $this->sanitize();
+
if ($this->isMain($clean['id_wiki']))
{
$this->values['title'] = 'Main Page';