From 565383644891b890d726eabb255d86f8dfd39459 Mon Sep 17 00:00:00 2001 From: Doug Palmer Date: Mon, 18 Jun 2018 13:47:12 +1000 Subject: [PATCH] Version 1.4.2.2 Fix index out of bounds error on formatted name construction Move to version of ala-auth compatible with CAS on oztaxa --- build.gradle | 4 ++-- grails-app/services/au/org/ala/bie/ImportService.groovy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index eff53058..b6c4a91a 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { } } -version "1.4.2.1" +version "1.4.2.2" group "au.org.ala" apply plugin:"eclipse" @@ -73,7 +73,7 @@ dependencies { compile 'org.grails.plugins:external-config:1.1.1' compile group: 'org.grails.plugins', name: 'ala-bootstrap3', version: '3.0.3' - compile(group: 'org.grails.plugins', name: 'ala-auth', version:'3.1.0') { + compile(group: 'org.grails.plugins', name: 'ala-auth', version:'3.0.4') { exclude group: 'javax.servlet', module: 'servlet-api' } compile group: 'org.grails.plugins', name: 'ala-admin-plugin', version: '2.0' diff --git a/grails-app/services/au/org/ala/bie/ImportService.groovy b/grails-app/services/au/org/ala/bie/ImportService.groovy index 050881a8..bfb2a71d 100644 --- a/grails-app/services/au/org/ala/bie/ImportService.groovy +++ b/grails-app/services/au/org/ala/bie/ImportService.groovy @@ -2149,9 +2149,9 @@ class ImportService { return nameFormatted if (nameComplete) { def authorIndex = scientificNameAuthorship ? nameComplete.indexOf(scientificNameAuthorship) : -1 - if (authorIndex < 0) + if (authorIndex <= 0) return "${StringEscapeUtils.escapeHtml(nameComplete)}" - def preAuthor = nameComplete.substring(0, authorIndex - 1).trim() + def preAuthor = nameComplete.substring(0, authorIndex).trim() def postAuthor = nameComplete.substring(authorIndex + scientificNameAuthorship.length()).trim() def name = "" if (preAuthor && !preAuthor.isEmpty())