Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
1.1.2
-
None
-
-
Yes
-
Empty show more show less
Description
By manipulating the STKPager paging-parameter "currentPage" a freemarker exception is thrown.
The problem occurs by following values:
- 0
- empty
- text
- big integer
- very big number (long)
The function getCurrentPage() should handle the wrong parameters.
public int getCurrentPage() { int currentPage = 1; String paramCurrent = MgnlContext.getParameter("currentPage"); if (StringUtils.isNotBlank(paramCurrent) && StringUtils.isNumeric(paramCurrent)) { try { currentPage = Integer.parseInt(paramCurrent); if (currentPage > getNumPages() || currentPage < 1) { currentPage = 1; } } catch (NumberFormatException e) { log.warn("Wrong currentPage parameter with value [{}] is given. Set currentPage to 1.", paramCurrent); } } return currentPage; }
Checklists
Acceptance criteria