From 084c6123f0a0fbf05ed4c0d776f05e084d9ecc58 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Fri, 18 Feb 2011 11:21:43 +0000 Subject: added new EasyGiant library --- h-source/Application/Models/HardwareModel.php | 9 +++++++-- h-source/Application/Models/WikiModel.php | 11 +++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'h-source/Application') 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'; -- cgit v1.2.3