/** * 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 (RLCache::has($hash)) { return RLCache::get($hash); } foreach ($tags as $i => $tag) { if (RLText::is_alphanumeric($tag['0'])) { $tag = '{' . $tag; } $tags[$i] = $tag; if ($include_closing_tags) { $tags[] = preg_replace('#^([^a-z0-9]+)#', '\\1/', $tag); } } return RLCache::set($hash, array($tags, self::protectArray($tags, 1))); }