Changeset 37096


Ignore:
Timestamp:
2023-01-04T21:00:34+13:00 (16 months ago)
Author:
davidb
Message:

More careful typecasting for Element as we can now have TEXT_NODE reach here (which can occur when CGI arg 'excerptid-text' is used)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java

    r36913 r37096  
    13221322    data = docNode.getDocumentElement();
    13231323      }
    1324     else
     1324    else if (nodeType == Node.ELEMENT_NODE)
    13251325      {
    13261326    data = (Element) dataNode;
    13271327      }
    13281328
     1329    // Normally 'dataNode' is an Element or Document, but it is possible for it to be one of the other Node types
     1330    // (e.g., Node.TEXT_NODE, which is generated when using excerptid-text=xxxx)
     1331    // For these simpler cases, there is no URL encoding work to be done, so leaving 'data' as null is sufficient
     1332   
    13291333    if (data != null)
    13301334      {
Note: See TracChangeset for help on using the changeset viewer.