aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-02-18 02:19:48 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-02-18 02:19:48 +0000
commita855ea347f8668cefb04360b2d7158d8939e07ac (patch)
tree0f20e42e542647f7151d9f78b3911a8edf2861b7 /h-source/Application/Models
parent0f42e1a7816893e083f49c933d1393a102a3510e (diff)
improved wiki
Diffstat (limited to 'h-source/Application/Models')
-rw-r--r--h-source/Application/Models/WikiModel.php10
1 files changed, 6 insertions, 4 deletions
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');