diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/Post.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/models/Post.php b/models/Post.php index ec82ca2..bb3abd7 100644 --- a/models/Post.php +++ b/models/Post.php @@ -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); |