Changeset 29112

Show
Ignore:
Timestamp:
03.07.2014 14:36:25 (5 years ago)
Author:
kjdon
Message:

when tidying up OIDs, replace periods with _ instead of just removing it, otherwise 10.1 will end up the same as 1.01. Do the same thing for forward and back slashes - these screw up folders/URls etc

Files:
1 modified

Legend:

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

    r28997 r29112  
    447447sub tidy_up_oid { 
    448448    my ($OID) = @_; 
    449     if ($OID =~ /\./) { 
    450     print STDERR "Warning, identifier $OID contains periods (.), removing them\n"; 
    451     $OID =~ s/\.//g; #remove any periods 
     449    if ($OID =~ /[\.\/\\]/) { 
     450    print STDERR "Warning, identifier $OID contains periods or slashes(.\\\/), replacing them with _\n"; 
     451    $OID =~ s/[\.\\\/]/_/g; #remove any periods 
    452452    } 
    453453    if ($OID =~ /^\s.*\s$/) {