From a855ea347f8668cefb04360b2d7158d8939e07ac Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Fri, 18 Feb 2011 02:19:48 +0000 Subject: improved wiki --- h-source/Application/Models/WikiModel.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'h-source/Application/Models') diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php index 2ee7505..3e768d3 100644 --- a/h-source/Application/Models/WikiModel.php +++ b/h-source/Application/Models/WikiModel.php @@ -53,11 +53,13 @@ class WikiModel extends Model_Map { $this->strongConditions['insert'] = array( "checkLength|99" => 'title|'.gtext('title is too length'), + "+checkNotEmpty" => 'page', "+checkLength|9000" => 'page|'.gtext('the page text is too length'), ); $this->strongConditions['update'] = array( "checkLength|99" => 'title|'.gtext('title is too length'), + "+checkNotEmpty" => 'page', "+checkLength|9000" => 'page|'.gtext('the page text is too length'), ); @@ -95,8 +97,8 @@ class WikiModel extends Model_Map { $clean['id'] = $resId[0]['wiki']['id_wiki']; $this->lastId = $clean['id']; $this->lastTitle = $resId[0]['wiki']['title']; - $this->lastTitleClean = encodeUrl($resId[0]['wiki']['title']); - $this->db->update('wiki','title_clean',array($this->lastTitleClean),'id_wiki='.$clean['id']); + $this->lastTitleClean = titleForRedirect($resId[0]['wiki']['title']); + $this->db->update('wiki','title_clean',array(encodeUrl($resId[0]['wiki']['title'])),'id_wiki='.$clean['id']); //update the history table $this->updateHistory('insert'); @@ -138,7 +140,7 @@ class WikiModel extends Model_Map { { $this->lastId = $clean['id']; $this->lastTitle = $this->values['title']; - $this->lastTitleClean = $this->values['title_clean']; + $this->lastTitleClean = html_entity_decode($this->values['title_clean'],ENT_QUOTES,DEFAULT_CHARSET); //update the history table $this->updateHistory('update'); @@ -190,7 +192,7 @@ class WikiModel extends Model_Map { { $this->lastId = $clean['id_wiki']; $this->lastTitle = $this->values['title']; - $this->lastTitleClean = $this->values['title_clean']; + $this->lastTitleClean = html_entity_decode($this->values['title_clean'],ENT_QUOTES,DEFAULT_CHARSET); //update the history table $this->updateHistory('update'); -- cgit v1.2.3