Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions samples-and-tests/pdf/app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public class Application extends Controller {
* @throws MalformedURLException in case of error
*/
public static void image(String id) throws MalformedURLException, IOException {
File file = new File("/" + Play.frameworkPath + "/documentation/images/" + id + ".png");
String safeId = new File(id).getName();
File file = new File("/" + Play.frameworkPath + "/documentation/images/" + safeId + ".png");

if (file.exists()) {
Logger.debug("Serving image at '%s'", file.getAbsolutePath());
Expand Down Expand Up @@ -198,4 +199,4 @@ private static String toHTML(String textile) {
// Extracts only the body of this HTML page
return html.substring(html.indexOf("<body>") + 6, html.lastIndexOf("</body>"));
}
}
}