Changeset 36903


Ignore:
Timestamp:
2022-11-14T12:04:10+13:00 (3 weeks ago)
Author:
kjdon
Message:

csvContains - made param names more general, and added trim() in case accidental spaces have got into the csv

File:
1 edited

Legend:

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

    r36592 r36903  
    124124    }
    125125
    126   public static boolean csvContains(String user_groups, String this_group)
     126  public static boolean csvContains(String csv_string, String this_item)
    127127  {
    128     String[] groups_array = user_groups.split(",");
    129     for (int i=0; i<groups_array.length; i++) {
    130       if (groups_array[i].equals(this_group)) {
     128    String[] csv_array = csv_string.split(",");
     129    for (int i=0; i<csv_array.length; i++) {
     130      if (csv_array[i].trim().equals(this_item)) {
    131131    return true;
    132132      }
Note: See TracChangeset for help on using the changeset viewer.