aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Models')
-rw-r--r--h-source/Application/Models/HardwareModel.php9
-rw-r--r--h-source/Application/Models/WikiModel.php11
2 files changed, 16 insertions, 4 deletions
diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php
index 17565ff..7df7a65 100644
--- a/h-source/Application/Models/HardwareModel.php
+++ b/h-source/Application/Models/HardwareModel.php
@@ -119,6 +119,8 @@ class HardwareModel extends Model_Map {
$revisions = new RevisionsModel();
$revisions->values = $oldValues;
+ $revisions->sanitize();
+
if ($revisions->insert())
{
parent::update($clean['id']);
@@ -162,11 +164,14 @@ class HardwareModel extends Model_Map {
if (count($newStruct > 0))
{
$revisions->values = $oldStruct[0]['hardware'];
-
+ $revisions->sanitize();
+
$this->values = $newStruct[0]['revisions'];
$this->values['updated_by'] = (int)$this->id_user;
$this->values['update_date'] = date('Y-m-d H:i:s');
-
+
+ $this->sanitize();
+
if ($revisions->insert())
{
if (parent::update($clean['id_hard']))
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';