Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-27203

SimpleRuleHandler does not match correctly when more OS entries is selected

    Details

      Description

      Current code in com.liferay.portal.mobile.device.rulegroup.rule.impl.SimpleRuleHandler does not match correctly, when you define more operation systems. Current code:

      if (Validator.isNotNull(os)) {
      if (os.equals(device.getOS()))

      { result = true; }

      else

      { result = false; }
      }

      will fail for >1 systems defined, since "os" is a comma delimited String of mobile operation systems (e.g. "iPhone OS,Android"). Needs to be update to something like:

      if (Validator.isNotNull(os)) {

      String[] operationSystemsToBeMatched = StringUtil.split(os);

      if (ArrayUtil.contains(operationSystemsToBeMatched, device.getOS())) { result = true; }
      else { result = false; }

      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              josef.sustacek Josef Šustáček
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 38 weeks, 1 day ago

                  Packages

                  Version Package
                  6.1.20 EE GA2
                  --Sprint 11/12
                  6.2.0 CE M2