/** * prepare the tags and protected tags array */ private static function prepareTags($tags, $include_closing_tags = true) { if (!is_array($tags)) { $tags = array($tags); } $hash = md5('prepareTags_' . json_encode($tags) . '_' . $include_closing_tags); if (NNCache::has($hash)) { return NNCache::get($hash); } foreach ($tags as $i => $tag) { if (!NNText::is_alphanumeric($tag['0'])) { continue; } $tags[$i] = '{' . $tag; if ($include_closing_tags) { $tags[] = '{/' . $tag; } } return NNCache::set($hash, array($tags, self::protectArray($tags, 1))); }