Skip to content

Commit

Permalink
Item14415: Use NFKD comparisons when inserting entries.
Browse files Browse the repository at this point in the history
This leaves in some commented debug prints.   There is still an issue
that can cause out-of-order inserts.  Any entry that is not a wikiword
"terminates" the list, and all inserts go before the non-wikiword entry.
This really should not happen unless the topic was manually maintained,
but if it happens, future registrations end up in the wrong place.
  • Loading branch information
gac410 committed Jun 10, 2017
1 parent 9c3adc4 commit 711dde2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion TopicUserMappingContrib/lib/Foswiki/Users/TopicUserMapping.pm
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,16 @@ m/^\s+\*\s($Foswiki::regex{webNameRegex}\.)?($Foswiki::regex{wikiWordRegex})\s*(
$odate = ''
unless $odate =~ m/^\d+[- .\/]+[A-Za-z0-9]+[- .\/]+\d+$/;
$insidelist = 1;

#print STDERR "1: Found $web.$name.$odate $insidelist\n";
}
elsif ( $line =~ m/^\s+\*\s([A-Z]) - / ) {
elsif ( $line =~ m/^\s+\*\s([[:upper:]]) - / ) {

# * A - <a name="A">- - - -</a>^M
$name = $1;
$insidelist = 1;

#print STDERR "2: Found $name $insidelist\n";
}
elsif ( $insidelist == 1 ) {

Expand All @@ -426,18 +430,24 @@ m/^\s+\*\s($Foswiki::regex{webNameRegex}\.)?($Foswiki::regex{wikiWordRegex})\s*(
# in all alphabets
$insidelist = 2;
$name = '';

#print STDERR "3: Found $name $insidelist\n";
}
if ( ( $name && ( $wikiname le $name ) ) || $insidelist == 2 ) {

#print STDERR "4: Found $wikiname le $name || $insidelist\n";
# found alphabetical position or last record
if ( $wikiname eq $name ) {

#print STDERR "5: Found $wikiname eq $name\n";

next if ( $action eq 'del' );

# adjusting existing user - keep original registration date
$entry .= $odate;
}
else {
print STDERR "6: Appending $today to $entry NL $line \n";
$entry .= $today . "\n" . $line;
}

Expand Down

0 comments on commit 711dde2

Please sign in to comment.