* @param response the HttpServletResponse instance
* @return the name of the next view
*/
public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
AbstractBlog blog = (AbstractBlog)getModel().get(Constants.BLOG_KEY);
BlogManager blogManager = BlogManager.getInstance();
String blogId = request.getParameter("id");
Configuration config = PebbleContext.getInstance().getConfiguration();
String regex = (config.isVirtualHostingEnabled() && !config.isVirtualHostingSubdomain()) ? "[\\.\\w-~]*" : "[\\w-~]*";
if (blogId != null && blogId.length() > 0 && blogId.matches(regex) && blogManager.getBlog(blogId) == null) {
blogManager.addBlog(blogId);
}
return new RedirectView(blog.getUrl() + "viewBlogs.secureaction");
}