Changeset 29112 for main/trunk


Ignore:
Timestamp:
2014-07-03T14:36:25+12:00 (10 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

File:
1 edited

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$/) {
Note: See TracChangeset for help on using the changeset viewer.