Changeset 36478 for main/trunk


Ignore:
Timestamp:
2022-08-25T08:39:44+12:00 (20 months ago)
Author:
kjdon
Message:

don't allow whitespace inside an OID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/util.pm

    r35452 r36478  
    527527    if ($OID =~ /[\.\/\\]/) {
    528528    print STDERR "Warning, identifier $OID contains periods or slashes(.\\\/), replacing them with _\n";
    529     $OID =~ s/[\.\\\/]/_/g; #remove any periods
     529    $OID =~ s/[\.\\\/]/_/g; #replace periods and slasshes with _
    530530    }
    531531    if ($OID =~ /^\s.*\s$/) {
     
    534534    $OID =~ s/^\s+//;
    535535    $OID =~ s/\s+$//;
     536    }
     537    if ($OID =~ /\s/) {
     538    print STDERR "Warning, identifier $OID contains whitespace. Replacing it with _\n";
     539    $OID =~ s/\s+/_/g; # replace whitespace with _
    536540    }
    537541    if ($OID =~ /^[\d]*$/) {
Note: See TracChangeset for help on using the changeset viewer.