& character in category name causes error

Description

To recreate this bug: From the home page, select "DNS & DHCP Servers" in the
Categories box. On the category page, select either "All" or "With outages". The
following error orrurs:

org.opennms.web.category.CategoryNotFoundException: Could not find the DNS category
at org.apache.jsp.rtc.category_jsp._jspService(org.apache.jsp.rtc.category_jsp:82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Workaround: replace "&" with "and" in etc/categories.xml and etc/viewsdisplay.xml

Environment

Operating System: Linux Platform: PC

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

DJ Gregor February 15, 2007 at 12:53 AM

This was fixed in revision 5678 in trunk.

The fix is to edit rtc/category.jsp, add org.opennms.web.Util to the include list near the top and wrap
the call to "category.getName()" on the three lines with "onclick=..." inside of Util.encode(...). E.g.:

onclick="top.location = '/opennms/rtc/category.jsp?category=<%=Util.encode(category.getName())%
>&amp;showoutages=all'" ></input>All

As part of the same patch, I Util.encoded or Util.htmlify'ed everything.

http://opennms.svn.sourceforge.net/viewvc/opennms?view=rev&revision=5678

Thanks, Bill, for reporting this. I'll add it to as a known bug in 1.3.2.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

PagerDuty

Created January 10, 2007 at 10:36 AM
Updated January 27, 2017 at 4:32 PM
Resolved February 15, 2007 at 12:53 AM