Browse Source

Update functions.php

pull/189/head
Danang Probo Sayekti 10 years ago
parent
commit
985de9d2dc
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      system/includes/functions.php

+ 5
- 2
system/includes/functions.php View File

@ -945,16 +945,19 @@ function get_description($string, $char = null)
}
}
if (strlen(strip_tags($string)) < $char) {
$string = preg_replace('/\s\s+/', ' ', strip_tags($string));
$string = remove_accent($string);
$string = preg_replace('/[^A-Za-z0-9 !@#$%^&*(),.-]/u', '', strip_tags($string));
$string = ltrim(rtrim($string));
return $string;
} else {
$string = preg_replace('/\s\s+/', ' ', strip_tags($string));
$string = remove_accent($string);
$string = preg_replace('/[^A-Za-z0-9 !@#$%^&*(),.-]/u', '', strip_tags($string));
$string = ltrim(rtrim($string));
$string = substr($string, 0, $char);
$string = substr($string, 0, strrpos($string, ' '));
return $string;
}
}
// Get the teaser


Loading…
Cancel
Save