The munged ids were looking pretty nasty, and were not completly guaranteed
to be unique. So a md5sum seems like a better approach. (Would have used
sha1, but md5 is in perl core.)
# comment.
my $page=shift;
- # It needs to start with a letter.
- $page="comment_".$page;
-
- # Encode any illegal characters.
- $page=~s/([^A-Za-z0-9-_:.])/"__".ord($1)."__"/eg;
+ eval q{use Digest::MD5 'md5_hex'};
+ error($@) if $@;
- return $page;
+ return "comment-".md5_hex($page);
}
package IkiWiki::PageSpec;