mraible commented on code in PR #169:
URL: https://github.com/apache/roller/pull/169#discussion_r3891439156
##########
app/src/main/webapp/themes/frontpage/directory.vm:
##########
@@ -31,10 +31,15 @@
<div id="tabContent">
<div id="directory">
- #if($model.getRequestParameter("weblog"))
- #set($handle = $model.getRequestParameter("weblog"))
- <a href="?letter=$utils.left($handle,1)">Back to blog
directory</a>
- #set($profileWeblog = $site.getWeblog($handle))
+ ## Render the profile only for a weblog that exists, and build
+ ## the back-link from the resolved weblog's own handle.
+ #set($profileWeblog = false)
+ #set($requestedHandle = $model.getRequestParameter("weblog"))
+ #if($requestedHandle)
+ #set($profileWeblog = $site.getWeblog($requestedHandle))
Review Comment:
`$site.getWeblog()` still receives the raw parameter.
`JPAWeblogManagerImpl.getWeblogByHandle` throws `WebloggerException("Invalid
handle: '...'")` for anything outside `[A-Za-z0-9_]`, and `SiteModel.getWeblog`
logs that at ERROR with a stack trace. A cheap pre-check such as
`#if($requestedHandle && $requestedHandle.matches("[A-Za-z0-9_]+"))` keeps
garbage from reaching the manager.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]