private function validateSlug($sSlug, $sTitle, $iId = null)
    {
        /**
         * Slugs don't matter in preview mode
         */
        if ($this->isPreviewMode) {
            return 'slug';
        }

        // --------------------------------------------------------------------------

        /**
         * Handle the slug
         * If a slug has been provided, check it is unique, if one hasn't then
         * generate one.
         */

        if (empty($sSlug)) {

            $sSlug  = $this->generateSlug($sTitle);

        } else {

            $oDb = Factory::service('Database');

            if (!empty($iId)) {
                $oDb->where('id !=', $iId);
            }
            $oDb->where('slug', $sSlug);
            if ($oDb->count_all_results($this->table)) {
                $this->setError('Slug "' . $sSlug . '" is already in use by another post.');
                return false;
            }
        }

        //  If a the slug is a reserved word then bail out
        if (array_search($sSlug, $this->reservedWords) !== false) {

            $this->setError('Slug "' . $sSlug . '" is a reserved word and cannot be used.');
            return false;
        }

        return $sSlug;
    }