From cc7ad5299f1bd14155d4c01af3a4ece28f85c20c Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 10 Jan 2019 22:44:39 +0100 Subject: bug fixies --- app/class/art2.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/class/art2.php') diff --git a/app/class/art2.php b/app/class/art2.php index cb4949d..a378bd4 100644 --- a/app/class/art2.php +++ b/app/class/art2.php @@ -152,7 +152,11 @@ class Art2 public function description($type = 'string') { - return $this->description; + if($type == 'short' && strlen($this->description) > 15 ) { + return substr($this->description, 0, 15) . '.'; + } else { + return $this->description; + } } public function tag($option = 'array') @@ -441,7 +445,7 @@ class Art2 public function setid($id) { - if (strlen($id) < Model::MAX_ID_LENGTH and is_string($id)) { + if (strlen($id) <= Model::MAX_ID_LENGTH and is_string($id)) { $this->id = strip_tags(strtolower(str_replace(" ", "", $id))); } } @@ -687,7 +691,7 @@ class Art2 public function settemplateoptions($templateoptions) { if(is_array($templateoptions)) { - $this->templateoptions = array_filter($templateoptions); + $this->templateoptions = array_values(array_filter($templateoptions)); } } -- cgit v1.2.3