|
|
@@ -26,13 +26,9 @@ class Post extends \lithium\data\Model {
|
|
|
*/
|
|
|
public function parse($entity, $input)
|
|
|
{
|
|
|
- $words;
|
|
|
- if (is_array($input)) {
|
|
|
- $words = $input;
|
|
|
- }
|
|
|
- else {
|
|
|
- $words = explode(" ", $input);
|
|
|
- }
|
|
|
+
|
|
|
+ //If $input is an array, set words to it otherwise, explode it.
|
|
|
+ $words = (is_array($input)) ? $input : explode(" ", $input);
|
|
|
|
|
|
//Count the number of words
|
|
|
$count = count($words);
|